Go to All Forums

Server Agent is broken on FreeBSD 12

Hi,

 

I was excited to use Site24x7 for monitoring instead of the competition as it claims to support FreeBSD, which sadly is not quite the case. There are a number of issues with the agent on FreeBSD 12 (which has been out since 2018). Below is a list of issues I encountered, they should all be easy to fix. 

FreeBSD 12.1-STABLE r354923 GENERIC amd64
Python 3.6.9

 

1) I guess this is more of a python problem, but pycrypt does not compile, GMP is installed, adding the following CFLAGS fixes the issue export "CFLAGS=-I/usr/local/include -L/usr/local/lib" , all of the required python modules install just fine from the ports, perhaps the agent should use those instead.

building 'Crypto.PublicKey._fastmath' extension
creating build/temp.freebsd-12.1-STABLE-amd64-3.6
creating build/temp.freebsd-12.1-STABLE-amd64-3.6/src
cc -Wno-unused-result -Wsign-compare -Wunreachable-code -pipe -fstack-protector-strong -fno-strict-aliasing -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/ -I/usr/local/include/python3.6m -c src/_fastmath.c -o build/temp.freebsd-12.1-STABLE-amd64-3.6/src/_fastmath.o
src/_fastmath.c:36:11: fatal error: 'gmp.h' file not found
# include <gmp.h>
^~~~~~~
1 error generated.
error: command 'cc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /opt/site24x7/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-gdqaliw8/pycrypto/setup.py'"'"'; __file__='"'"'/tmp/pip-install-gdqaliw8/pycrypto/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-4t3dejon/install-record.txt --single-version-externally-managed --compile --install-headers /opt/site24x7/venv/include/site/python3.6/pycrypto Check the logs for full command output.

 

2) The agent runs as root, install script assumes a user has been magically created for it.

chown: site24x7-agent: illegal user name

PRODUCT_NAME='Site24x7'
PRODUCT_NAME_UPPERCASE='SITE24X7'
PRODUCT_NAME_LOWERCASE='site24x7'
MON_AGENT_NAME='monagent'
MON_AGENT_GROUP=$PRODUCT_NAME_LOWERCASE'-group'
MON_AGENT_USER=$PRODUCT_NAME_LOWERCASE'-agent'

3) Missing and inaccurate stats.

The CPU usage is always reported at 50%, even though the server is idle. Yet the per core report is correct.

Processes do not display, yet when you click on tools you can see them there.

Various stats are missing, such as context switches and interrupts.

 

Thanks.

 

 

 

 

Like (3) Reply
Replies (10)

Re: Server Agent is broken on FreeBSD 12

Hi Mike ,

      Thanks for the feedback.

#1) PyCrypto issue - Python modules are installed using pip (a package installer for python). We tried FREEBSD v12 + Python 3.6.9 in our test environment and found no issues while installing the python modules. Please contact support@site24x7.com to set up a remote session and look into this issue.

#2) chown issue - This will be fixed and updated in the next agent version release.

#3) Missing and inaccurate stats

  • CPU issue - This will be fixed and updated in the next agent version release.
  • Processes do not appear - Click on the Discover Process button in the Processes tab and check the active processes that are discovered from the server. You might be able to find the process and click Add+ to add it for monitoring.
  • Stats such as context switches and interrupts are missing - Please send the agent logs to support@site24x7.com  to further analyze the issue.
    Note: Logs will be present under the folder : /opt/site24x7/monagent/logs

Hope this helps. We shall post in this thread once the updated agent version is live. For further queries, if any, please comment below. 

 

Regards,

Sriram

Like (0) Reply

Re: Re: Server Agent is broken on FreeBSD 12

Hi,
 
I'm looking forward to trying the new version.
 
1) This is a BSD/Python issue that has been reported by people previously. Simple fix though, just add /usr/local/include and lib to CFLAGS before compiling, perhaps you could add that to your install script, it should not break anything for cases where it does work.
 
www.ateamsystems.com/tech-blog/solved-freebsd-pip-virtualenv-file-not-found/
 
2) Great.
 
3) I have emailed the logs. (It appears to me that the agent is collecting the data, but it was not visible on your website)
 
Thanks.
Like (0) Reply

Re: Re: Re: Server Agent is broken on FreeBSD 12

Hi,


We have fixed these issues in our latest agent release. Please contact support@site24x7.com for further assistance.

Regards
Sriram

Like (0) Reply

Re: Re: Re: Re: Server Agent is broken on FreeBSD 12

It is still broken, same exact issues.

I downloaded the agent from staticdownloads.site24x7.com/server/Site24x7InstallScript.sh .

---

[root@fbsd12 ~]# sh Site24x7InstallScript.sh -i -key=secret
curl detected
/usr/local/bin/bash
Detected OS : FreeBSD
Detected os arch : amd64
Hybrid agent support needed
Download url : staticdownloads.site24x7.com/server/Site24x7MonitoringAgent.install

      -----------------------------------------------------------------------------------------------------------------------------------------------------
      |																			  |
      |							      Site24x7 Server Monitoring Agent Installation					         |
      |																			  |
      -----------------------------------------------------------------------------------------------------------------------------------------------------



      --------------------------------------------------------Downloading install file for Site24x7MonitoringAgent.install----------------------------------------------------------

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0/sbin/init: ELF 64-bit LSB executable, x86-64, version 1 (FreeBSD), statically linked, for FreeBSD 12.1 (1201502), FreeBSD-style, stripped
100 1720k  100 1720k    0     0   814k      0  0:00:02  0:00:02 --:--:--  814k
Site24x7InstallScript.sh: [[: not found
Site24x7InstallScript.sh: [[: not found
/usr/local/bin/python3
tar detected
Site24x7MonitoringAgent.install: line 258: /opt/site24x7/site24x7install.log: No such file or directory
Extracting Binaries From Tar File
--2019-12-11 04:04:32--  staticdownloads.site24x7.com/server/linuxagent.tar.gz
Resolving staticdownloads.site24x7.com (staticdownloads.site24x7.com)... 8.39.54.124
Connecting to staticdownloads.site24x7.com (staticdownloads.site24x7.com)|8.39.54.124|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1722174 (1.6M) [application/octet-stream]
Saving to: '/opt/site24x7/site24x7agent.tar.gz'

/opt/site24x7/site24x7agent.tar.gz      100%[===============================================================================>]   1.64M  1.08MB/s    in 1.5s    

2019-12-11 04:04:34 (1.08 MB/s) - '/opt/site24x7/site24x7agent.tar.gz' saved [1722174/1722174]

Successfully Extracted Agent Files to The Directory : /opt/site24x7
/usr/local/bin/bash
Detected shell ---> bash
Setting up virtual environment
/opt/site24x7/monagent/pypi/virtualenv.py:1086: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  import imp
Done
compile python packages : False
Installing python packages using pip
Collecting pip
  Cache entry deserialization failed, entry ignored
  Using cached files.pythonhosted.org/packages/00/b6/9cfa56b4081ad13874b0c6f96af8ce16cfbc1cb06bedf8e9164ce5551ec1/pip-19.3.1-py2.py3-none-any.whl
Collecting setuptools
  Downloading files.pythonhosted.org/packages/54/28/c45d8b54c1339f9644b87663945e54a8503cfef59cf0f65b3ff5dd17cf64/setuptools-42.0.2-py2.py3-none-any.whl (583kB)
    100% |████████████████████████████████| 583kB 1.6MB/s 
Collecting wheel
  Using cached files.pythonhosted.org/packages/00/83/b4a77d044e78ad1a45610eb88f745be2fd2c6d658f9798a15e384b7d57c9/wheel-0.33.6-py2.py3-none-any.whl
Installing collected packages: pip, setuptools, wheel
Successfully installed pip-19.3.1 setuptools-42.0.2 wheel-0.33.6
Done
  ERROR: Command errored out with exit status 1:
   command: /opt/site24x7/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-kk33ngsg/pycrypto/setup.py'"'"'; __file__='"'"'/tmp/pip-install-kk33ngsg/pycrypto/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-baridqfl --python-tag cp38
       cwd: /tmp/pip-install-kk33ngsg/pycrypto/
  building 'Crypto.PublicKey._fastmath' extension
  creating build/temp.freebsd-12.1-STABLE-amd64-3.8
  creating build/temp.freebsd-12.1-STABLE-amd64-3.8/src
  cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -pipe -march=native -fstack-protector-strong -fno-strict-aliasing -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/ -I/usr/local/include/python3.8 -c src/_fastmath.c -o build/temp.freebsd-12.1-STABLE-amd64-3.8/src/_fastmath.o
  src/_fastmath.c:36:11: fatal error: 'gmp.h' file not found
  # include <gmp.h>
            ^~~~~~~
  1 error generated.
  error: command 'cc' failed with exit status 1
Done
chown: site24x7-agent: illegal user name
Site24x7 monitoring agent watchdog service started successfully (process id : 1726)
Site24x7 monitoring agent service started successfully (process id : 1749)

Have more servers? Try our bulk installation technique using SSH. Refer link : www.site24x7.com/app/client#/admin/inventory/monitors-configure/SERVER/site24x7remoteinstall





Like (0) Reply

Re: Re: Re: Re: Re: Server Agent is broken on FreeBSD 12

Hi Mike,

We had a temporary issue in our build update. Kindly try downloading and installing our latest agent now (version 17.5.3) and let us know.

 

Regards

Sriram

Like (0) Reply

Re: Re: Re: Re: Re: Re: Server Agent is broken on FreeBSD 12

Hi,

 

The CPU is showing correctly but there are still a number of things that are not working.

 

1) Agent still runs as root

2) Memory usage is not calculated properly, only Active and Wired should be considered as used memory.

3) Int/cx switches still do not log anything

4) Disk IO is not logged

5) Not all processes are discovered, seems like it only shows some random ones owned by root

6) Not a big issue but network media speed is incorrectly reported, the server has media: Ethernet 10Gbase-T <full-duplex>  while you report it as 100Mbit.

 

Like (0) Reply

Re: Re: Re: Re: Re: Re: Re: Server Agent is broken on FreeBSD 12

Hi Mike,

#1) Agent still runs as root -  You can install the agent as a non-root user by providing an additional install parameter -nr

#2) Incorrect memory usage - Memory utilization is calculated using vmstat and sysctl -n hw.physmem commands. So, the total memory is calculated by the formula: Total - free/total *100 

#3) int/cx switches do not log anything - This is because we don't log the raw value obtained during polling. It is represented as a per second value.

Disk I/O, processes not getting listed will be fixed and updated as a new agent release. Hope this clarifies your queries.

For any other questions, please comment in the below thread.

 

Regards,

Sriram 

Like (0) Reply

Re: Re: Re: Re: Re: Re: Re: Re: Server Agent is broken on FreeBSD 12

Hi,

I'm not sure why you use this logic to show memory used but it is incorrect. The current method assumes that cached and memory that can be readily freed is actually used and unavilable. This leads the monitoring app to throw an alert on any system that has been up for a while, as ideally there is never any unused memory in system. You might want to read up on how UNIX and FreeBSD defines used memory.

jameshfisher.com/2017/11/29/unix-free-used/

wiki.freebsd.org/Memory

Thanks.

 

 

Like (0) Reply

Re: Re: Re: Re: Re: Re: Re: Re: Re: Server Agent is broken on FreeBSD 12

Hi Mike,

Thanks for the suggestion. We will definitely have a look at it and provide an updated agent version containing the issue fixes at the earliest.

 

Regards,

Sriram

Like (0) Reply

Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Server Agent is broken on FreeBSD 12

Hi Mike,

We have fixed the said issues in our latest agent release (version 17.5.5)

Kindly try out the same and let us know the feedback.

Note: Before reinstallation, kindly remove the existing install file Site24x7MonitoringAgent.install

 

 

Regards,

Sriram

Like (0) Reply

Was this post helpful?