Difference between revisions of "Zabbix"

From ArchWiki
Jump to navigation Jump to search
(add missing required module)
m (update link to renamed category)
Line 14: Line 14:
* [[nginx]]
* [[nginx]]
Or one of the other servers found in the [[:Category:Web Server|web server]] category.
Or one of the other servers found in the [[:Category:Web server|web server]] category.
You may edit the [[PKGBUILD]]s if you plan to use Nginx as web-server, since by default they have {{Pkg|apache}} and {{Pkg|php-apache}} as dependency.
You may edit the [[PKGBUILD]]s if you plan to use Nginx as web-server, since by default they have {{Pkg|apache}} and {{Pkg|php-apache}} as dependency.

Revision as of 19:43, 26 July 2015

Zabbix is a full-featured monitoring solution for larger networks. It can discover all kind of networking devices using different methods, check machine states and applications, sending pre-defined alarm messages and visualize complex data correlations.

Server setup


If you want to use the Zabbix server with MariaDB, install zabbix-server-mysqlAUR from the AUR. For PostgreSQL as database backend, you should use zabbix-serverAUR. You also have to choose a web server with PHP support, e.g.:

Or one of the other servers found in the web server category. You may edit the PKGBUILDs if you plan to use Nginx as web-server, since by default they have apache and php-apache as dependency.


Symlink the Zabbix web application directory to your http document root, e.g.:

$ ln -s /usr/share/webapps/zabbix /srv/http/zabbix

Make sure to adjust following variables to these minimal values in your php.ini:

post_max_size = 16M
max_execution_time = 300
max_input_time = 300
date.timezone = "UTC"
always_populate_raw_post_data = -1

In this example, we create on localhost a MariaDB database called zabbix for the user zabbix identified by the password test and then import the database templates. This connection will be later used by the Zabbix server and web application:

$ mysql -u root -p -e "create database zabbix"
$ mysql -u root -p -e "grant all on zabbix.* to zabbix@localhost identified by 'test'"
$ mysql -u zabbix -p zabbix < /usr/share/zabbix/database/schema.sql
$ mysql -u zabbix -p zabbix < /usr/share/zabbix/database/images.sql
$ mysql -u zabbix -p zabbix < /usr/share/zabbix/database/data.sql


Enable and start the zabbix-server service.

Finally you can access Zabbix via your local web server, e.g.:, finish the installation wizard and access the frontend the first time. The default username is Admin and password zabbix.

See appendix for a link to the official documentation, which explains all further steps in using it.

Agent setup


Currently, the server package already includes zabbix-agentAUR, so you do not have to install this package on your monitoring server. However, for monitoring targets, the client part is more minimal, standalone and easy to deploy, just install zabbix-agentAUR.


Simply edit the zabbix_agentd.conf and replace the server variable with the IP of your monitoring server. Only servers from this/these IP will be allowed to access the agent.


Further make sure the port 10050 on your device being monitored is not blocked and is properly forwarded.


Enable and start the zabbix-agentd service.

Tips and tricks

Debugging a Zabbix agent

On the client site, you can check the state of an item like this:

zabbix_agentd -t hdd.smart[sda,Temperature_Celsius]

On the server/monitoring site, try this:

zabbix_get -s host -k hdd.smart[sda,Temperature_Celsius]

Monitor ArchLinux system updates

Here's an approach on how to monitor your ArchLinux clients for available system update using a custom UserParameter:

UserParameter=archlinuxupdates,checkupdates | wc -l

You have to restart zabbix-agentd to apply the new configuration. The keyword for the item you later use in the web frontend is archlinuxupdates. It returns an integer representing the count of available updates.

See also