Warning: THE VOID WIKI IS DEPRECATED. It is no longer being maintained, contains outdated and incorrect information, and will eventually be shut down. Please refer to the Void Handbook, https://docs.voidlinux.org/, for the official documentation. If you can't find the information you're seeking, please raise an issue at https://github.com/void-linux/void-docs/issues

Zabbix -

From Void Linux Wiki
Jump to navigation Jump to search

Zabbix is a very popular Monitoring software for Networks, Operating Systems and Applications operating under UNIX systems and Windows, licensed under the GPL-2.0-or-later.

Zabbix uses a combination of Agent services installed on host machines, TCP, ICMP and SMNP protocols to verify availabilty and monitor system and application resources.

Void Linux's Zabbix package is configured to use MySQL as it's database backend.

Server installation

Install the zabbix package

 # xbps-install -S zabbix

Server configuration

Create a mysql database and grant it to the zabbix user, remember the password used as it will be configured in the future

 mysql> create database zabbix character set utf8 collate utf8_bin;
 mysql> grant all privileges on zabbix.* to zabbix@localhost identified by '<password>';
 mysql> flush privileges;
 mysql> quit;

Then import the initial schema, you will be prompted for the password you choose earlier. This operation can take a few minutes

 $ cat /usr/share/zabbix/mysql/schema.sql | mysql -u zabbix zabbix -p
 $ cat /usr/share/zabbix/mysql/images.sql | mysql -u zabbix zabbix -p
 $ cat /usr/share/zabbix/mysql/data.sql | mysql -u zabbix zabbix -p

Modify DBPassword= in /etc/zabbix_server.conf to match the password used in the database and DBSocket= to match the location used by MySQL


You can now start the Zabbix server service, which also requires the mysql service if you're already running it you can ignore the first command.

 # ln -s /etc/sv/mysqld /var/service
 # ln -s /etc/sv/zabbix-server /var/service
Note: Void Linux uses /var/log/zabbix-server instead of /tmp for the logs and /var/run/zabbix-server instead of /tmp for pidfiles

PHP Frontend

Zabbix offers a PHP frontend, this section will explain how to run it with apache, first install it, php-apache and zabbix-frontend-php

 # xbps-install -S apache php-apache zabbix-frontend-php

Follow the instrunctions on How to enable PHP for Apache

Create a soft-link from it to /srv/www/apache

 # ln -s /usr/share/webapps/zabbix /srv/www/apache

Modify permissions in /usr/share/webapps/zabbix/conf to _apache, so it has permissions to move the configuration during the setup phase

 # chown _apache:_apache /usr/share/webapps/zabbix/conf

Append the following to /etc/php/php.ini, these are modules from php and php-gd required and/or recommended by Zabbix's PHP frontend


Edit some configuration in /etc/php/php.ini to match requirements by Zabbix, the timezone can be checked in the PHP manual

 Max_execution_time = 600
 Expose_php = off
 Date.timezone = <insert your timezone here>
 post_max_size = 32M
 upload_max_filesize = 16M
 max_input_time = 600
 memory_limit = 256M

Enable the apache service

 # ln -s /etc/sv/apache /var/service

The PHP frontend should be available at, running it for the first time should redirect to setup.php