Translation(s): none


Zabbix and Debian

Overview

Zabbix is a server/client monitoring system available in Debian.

Documentation and informations

You can find informations about Zabbix here:

Debian packages

Debian splits Zabbix functionalities in few packages.

Look at the related descriptions in order to understand which of these packages fit your needs.

Installation

The following instructions will try to be as generic as possible and should work in Debian jessie, jessie-backports, stretch, and above.

Installing Zabbix server using MySQL/MariaDB

You should already have a MySQL server. If you have not, first install the default-mysql-server package.

All the below commands should be run as root.

Install the zabbix-server-mysql package:

apt-get install zabbix-server-mysql

Now open a MySQL shell as administrator, create a new database (e.g. "zabbix"), create a related MySQL/MariaDB username (e.g. "zabbix") with a strong password, and grant permissions to that username:

mysql --defaults-extra-file=/etc/mysql/debian.cnf
CREATE DATABASE zabbix;
CREATE USER 'zabbix'@'localhost' IDENTIFIED BY 'here-an-example-password-but-please-change-me';
GRANT ALL PRIVILEGES ON `zabbix`.* TO 'zabbix'@'localhost';
FLUSH PRIVILEGES;
quit

Do not forget the password you just entered for your Zabbix username because you have to write it down also in the configuration:

nano /etc/zabbix/zabbix_server.conf

DBName=zabbix
DBUser=zabbix
DBPassword=here-an-example-password-but-please-change-me

Now it's the time to populate your Zabbix database. Decompress the SQL files provided in /usr/share and import them:

cd /usr/share/zabbix-server-mysql
gunzip -d schema.sql.gz images.sql.gz data.sql.gz
cat schema.sql images.sql data.sql | mysql zabbix --user=zabbix --password=here-an-example-password-but-please-change-me

Note that it may need a couple of minutes. In the meanwhile you can entertain yourself with a Debian game.

After that you will have ~113 MySQL tables into your zabbix database.

Installing Zabbix PHP frontend

After installing the server, you can install the zabbix-frontend-php package that provides an user interface to administer your Zabbix instance.

apt-get install zabbix-frontend-php

If you use the Apache HTTP server and you just want to use the default Zabbix configuration, just remember to specify a PHP date.timezone in /etc/apache2/conf-available/zabbix-frontend-php.conf. If you want some additional PHP restrictions, you may want to set the open_basedir restriction to /usr/share/zabbix/:/var/lib/zabbix:/etc/zabbix:/usr/share/javascript.

Then you can enable that Apache configuration and you can reload the webserver:

a2ensite zabbix-frontend-php
systemctl reload apache2

Now follows the installation instructions for your http://your-host/zabbix. It may asks you of populating manually the /etc/zabbix/zabbix.conf.php configuration file. Follow its instructions. After that you should see something as «Congratulations! You have successfully installed Zabbix frontend. Configuration file "/etc/zabbix/zabbix.conf.php" created.» and you can do the login into your Zabbix frontend.

The default username/password credentials for you Zabbix frontend will be:

Note: never expose your Zabbix frontend to the world before changing these default credentials! You should quickly change your password visiting the /profile.php page of your Zabbix frontend.

Then have fun with your Zabbix frontend. Now you should know what you have to do with Zabbix. Some of my friends say that you can monitor whatever.

(These instructions are released under the CC BY-SA 4.0 / GNU GFL / GNU GPL v3+ at your opinion by Valerio Bozzolan)