Ubuntu 16.04
Sponsored Link

Zabbix : Install2016/06/06

 
Install Zabbix which is an enterprise open source monitoring system.
It's possible to monitor not only Linux but Windows, Solaris, IBM AIX and others.
[1]
[2]
[3]
[4] Install Zabbix server.
Install Zabbix Agent to monitor Zabbix server itself, too.
root@dlp:~#
apt-get -y install zabbix-server-mysql zabbix-agent zabbix-frontend-php php-mysql php-gd php-xml-util php-mbstring php-bcmath php-net-socket php-gettext

[5] Create a database for Zabbix.
root@dlp:~#
mysql -u root -p

Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 50
Server version: 10.0.24-MariaDB-7 Ubuntu 16.04

Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>
create database zabbix;

Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]>
grant all privileges on zabbix.* to zabbix@'localhost' identified by 'password';

Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]>
grant all privileges on zabbix.* to zabbix@'%' identified by 'password';

Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]>
flush privileges;

Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]>
exit

Bye
root@dlp:~#
cd /usr/share/zabbix-server-mysql

root@dlp:/usr/share/zabbix-server-mysql#
gunzip *.sql.gz

root@dlp:/usr/share/zabbix-server-mysql#
mysql -u root -p zabbix < schema.sql

Enter password:
root@dlp:/usr/share/zabbix-server-mysql#
mysql -u root -p zabbix < images.sql

Enter password:
root@dlp:/usr/share/zabbix-server-mysql#
mysql -u root -p zabbix < data.sql

Enter password:
[6] Configure and start Zabbix server.
root@dlp:~#
vi /etc/zabbix/zabbix_server.conf
# line 82: add DB name

DBName=
zabbix
# line 98: add DB user

DBUser=
zabbix
# line 106: uncomment and add DB user's password

DBPassword=
password
root@dlp:~#
systemctl restart zabbix-server
[7] Configure and start Zabbix Agent to monitor Zabbix server itself.
root@dlp:~#
vi /etc/zabbix/zabbix_agentd.conf
# line 137: change to own hostname

Hostname=
dlp.srv.world
root@dlp:~#
systemctl restart zabbix-agent
[8] Change Apache2 and PHP settings like follows.
root@dlp:~#
vi /usr/share/zabbix/include/classes/setup/CFrontendSetup.php
# line 348: add like follows

# It is because Zabbix initial setup requires "php always_populate_raw_post_data" is "off", but

# the option is removed on PHP7 which is default on Ubuntu16.04 and will not complete setup.

$current = ini_get('always_populate_raw_post_data');
$current = -1;

return array(
root@dlp:~#
vi /etc/php/7.0/apache2/php.ini
# line 368: change (Zabbix requirements)

max_execution_time =
300
# line 368: change (Zabbix requirements)

max_input_time =
300
# line 656: change (Zabbix requirements)

post_max_size =
16M
root@dlp:~#
vi /etc/apache2/conf-available/zabbix-frontend-php.conf
# add to the end: access permission to Web admin console

<Directory /usr/share/zabbix>
    Require local
    Require ip 10.0.0.0/24
</Directory>

root@dlp:~#
chown -R www-data /etc/zabbix

root@dlp:~#
a2enconf zabbix-frontend-php

Enabling conf zabbix-frontend-php.
To activate the new configuration, you need to run:
  service apache2 reload
root@dlp:~#
systemctl restart apache2
Matched Content