SSH Monitoring with Zabbix

From regify WIKI
Revision as of 11:46, 8 June 2020 by Regify (talk | contribs)
Jump to navigation Jump to search

The ZBX agent is not installed on the regify appliance and you are not allowed to install third party software. But it is easy to monitor the regify appliance with Zabbix using SSH agent.

Allow appliance login

Login with SSH to the regify appliance with root user. Then, create a user for zabbix monitoring:

adduser zabbix
passwd zabbix 

It will ask you for a password. Please use a very secure password (>= 12 characters)

Configure Zabbix monitoring items

In Zabbix, create a new host (eg "regify provider"). For the new host, you need to add SSH items for tests.

The following image is showing an item for checking current SSH user count on the machine every 10 minutes: Zabbix configuration example

useful item commands

Free appliance memory in percent:

free|grep "Mem:"|awk '{print ($4+$6)/($2/100)}'

Used disk space on / in percent:

df|grep "/$"|awk '{print $5}'|tr -d "%"

CPU load average of the last 5 minutes:

cat /proc/loadavg|cut -d " " -f2

Number of active SSH logins:

who|wc -l

Current MariaDB status:

systemctl status mariadb|grep active

Zabbix optimization

We found that SSH calls fail randomly. To fix this, we increased two values in /etc/zabbix/zabbix_server.conf:

timeout=10
StartPollers=100