Skip to content

Integration with Zabbix

1. 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.

2. 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.

2.1 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.

2.2 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

2.3 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}

2.4 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.

2.5 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}.