Zabbix — system monitoring, tracking servers and network equipment.
Below I will give an example of installing Zabbix Server and Zabbix Agent from the official Ubuntu repository, if you need to install the latest version, you must first install Zabbix repositories, for example, see my article – Installing Zabbix Server 3.4 on Ubuntu 16.04
Install the server, web interface and agent:
sudo apt-get install zabbix-server-mysql zabbix-frontend-php zabbix-agent traceroute fping
If during the installation did not configure the mysql parameters, then manually create the MySQL user and complete the rights to the database:
mysql -uroot -p
create database zabbix character set utf8 collate utf8_bin;
grant all privileges on zabbix.* to zabbix@localhost identified by 'PASSWORD';
exit
We import tables into the database:
cd /usr/share/zabbix-server-mysql
sudo gunzip schema.sql.gz
sudo gunzip images.sql.gz
sudo gunzip data.sql.gz
mysql -uroot -p zabbix < schema.sql
mysql -uroot -p zabbix < images.sql
mysql -uroot -p zabbix < data.sql
Configs are located at /etc/zabbix/
The web interface configuration is located at /etc/apache2/conf-available/zabbix
If it does not exist, you can copy the template and configure:
sudo cp /etc/zabbix/apache.conf /etc/apache2/sites-enabled/zabbix.conf
Or we will make a symbolic link to the web server directory on the zabbix files:
sudo ln -s /usr/share/zabbix/ /var/www/html/
Open the configuration file PHP for example in the editor nano (CTRL+X for exit, y/n for saving or canceling the changes):
sudo nano /etc/php5/apache2/php.ini
And change some of the minimum parameters:
date.timezone = Europe/Kiev
max_execution_time 300
memory_limit 128M
post_max_size 16M
upload_max_filesize 2M
max_input_time 300
For the changes to take effect, you must restart the web server:
sudo /etc/init.d/apache2 restart
Open the web interface at http://SERVER/zabbix/ and follow the prompts for further installation.
By default, the user name for logging in through the web interface is admin, the password is zabbix.
When saving the configuration file zabbix.conf.php there will be a message that there is no write permission, so we will temporarily allow them:
sudo chmod 777 /etc/zabbix
When the configuration file is saved back:
sudo chmod 755 /etc/zabbix
Also, in the second configuration file zabbix_server.conf, the login and password for connecting to the MySQL database (same as in zabbix.conf.php):
sudo nano /etc/zabbix/zabbix_server.conf
If the message appears in the web interface that the zabbix server is not running, then you need to change the START=no parameter to START=yes in the /etc/default/zabbix-server file and execute the start command:
sudo service zabbix-server start
After installation, I recommend changing the password to admin and disabling the guest user.