Integration with Zabbix
Description
Zabbix is a powerful network monitoring solution that provides real-time monitoring of various IT components, including servers, virtual machines, networks, and cloud services. It offers comprehensive monitoring capabilities, allowing administrators to track performance metrics, detect issues, and ensure smooth operation of their infrastructure.
Installation/Integration
As a general rule, the official documentation should be followed regarding installation of both the Zabbix Server and the Zabbix Agent 2.
Official Zabbix Documentation should be referenced at all times.
XMS specific configuration
After the zabbix repo has been installed to the target machine and the zabbix agent configured to communicate with the Zabbix server, there is a number of steps that need to be taken in order to monitor all the components of the XMS platform.
Docker Engine Monitoring
Zabbix has builtin support for monitoring docker engine since version 7.2. The template to monitor Docker engine by Zabbix, works without any external scripts. Most of the metrics are collected in one go, thanks to Zabbix bulk data collection.
After applying the Docker template to he target host, a last step can be to make the zabbix user a member of th docker group. That is easily achieved by the following command:
sudo usermod -a -G docker zabbix
and then restarting the zabbix agent so that the new setting can cbe enabled:
sudo systemctl restart zabbix2.agent
Postgres Database Monitoring
First step is to install the postgres plugin for the agent:
sudo apt install zabbix-agent2-plugin-postgresql
Then a DB user should be created with appropriate privileges, either from inside the container or though docker compose
docker compose exec -it postgres psql
CREATE USER zbx_monitor WITH PASSWORD '<PASSWORD>' INHERIT;
GRANT pg_monitor TO zbx_monitor;
The password for the DB user should be added in /etc/zabbix/zabbix_agent2.d/plugins.d/postgresql.conf or even /etc/zabbix/zabbix_agent.conf .
When all that is complete, all that remains is to return to the Zabbix web interface, locate the xms host and add the appropriate template , which is "PostgreSQL by Zabbix agent 2 active" and configure the equivalent macros {$PG.CONNSTRING.AGENT2} and {$PG.PASSWORD}
Nginx Web Server
Edit configuration file /etc/xms/config/nginx/nginx.conf.template and add the following block, inside the XMS_FQDN server block, e.g before '/idp/admin'. Allow and deny rules probably require some adjusting in order for the module to be fully functional.
location = /basic_status {
stub_status;
allow 127.0.0.1;
allow ::1;
deny all;
}
Remove container and restart nginx
In the Host configuration, update macros {$NGINX.STUB_STATUS.HOST} to the same value as ${XMS_FQDN} and {$NGINX.STUB_STATUS.PORT} to 443.
Certificate status
Add template Website certificate by Zabbix agent 2 active and under Macros update {$CERT.WEBSITE.HOSTNAME} to the same value as ${XMS_FQDN}.