Zabbix is an open source software for networks and application monitoring. Zabbix provides agents to monitor remote hosts as well as Zabbix includes support for monitoring via SNMP, TCP and ICMP checks. It offers real-time monitoring of thousands of metrics collected from servers, virtual machines, and any other kind of network device. The Steps to install Zabbix on CentOS 7 is as follows:
1) We need to have LAMP server configured on the machine.
2) We also need some extra PHP plugins installed. To install the required php plugin, open terminal & run the following command:
# sudo yum install php-cli php-devel php-common php-pear php-gd php-mysql php-xml php-mbstring
Once we have completed the above mentioned pre-requisites, we can now move ahead with Zabbix installation.
1) To install zabbix, we will firstly have to add official Zabbix repository on our Centos 7 system.
# rpm -Uv http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-1.el7.centos.noarch.rpm
2) After adding the repository, we will install the zabbix server agent along with other necessary packages.
# yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent zabbix-get zabbix-sender zabbix-java-gateway
1) Update the PHP time zone in the file ‘/etc/httpd/conf.d/zabbix.conf’
# vim /etc/httpd/conf.d/zabbix.conf
Change the following parameter
# php_value date.timezone Asia/kolkata
Save the file & exit
2) Then restart the httpd service to implement the changes made.
# systemctl restart httpd.service
3) Create a database & database user for zabbix.
# mysql -u root -p
4) After enter the password for root that you have setup while configuring LAMP server. Once logged in, create a database.
# MariaDB [(none)]> CREATE DATABASE zabbixdb CHARACTER SET utf8 COLLATE utf8_bin;
Then create username & grant access to ‘zabbixdb’ using following command:
# MariaDB [(none)]> GRANT ALL PRIVILEGES ON zabbixdb.* TO zabuser@localhost IDENTIFIED BY “flock6454;
# MariaDB [(none)]> FLUSH PRIVILEGES;
# MariaDB [(none)]> exit
Here, ‘zabuser’ is the name of the user for zabbixdb & ‘flock6454’ is the password for database.
5) Import the database Schema using below commands:
# cd /usr/share/doc/zabbix-server-mysql-3.4.4
# gunzip create.sql.gz
# mysql -u root -p zabbixdb < create.sql
# Enter password:
Then will be asked for password for user ‘zabuser’, input the password & within couple of minutes, database will be restored.
6) Specify database related information into the zabbix main configuration file:
# sudo vim /etc/zabbix/zabbix_server.conf
Mention the following information in the file:
Save file & exit.
7) Then start the zabbix server & zabix agent services, then also enable them at boot:
# systemctl start zabbix-server && systemctl start zabbix-agent
# systemctl enable zabbix-server && systemctl enable zabbix-agent
Configuration via Web UI
1) To install zabbix, open a internet browser & enter the following URL in the address bar.
# http://localhost/zabbix from local system.
# http://IP_Address/zabbix from a remote system
2) Click on ‘Next step’.
On this Step Zabbix Pre-requisites are checked and verified.
3) Click on ‘Next step’
Specify the Zabbix Database name, database user and its password.
4) Click on ‘Next step’ to continue.
Specify the Zabbix Server details and Port number.
5) Click on ‘Next step’ to continue.
Pre-installation summary of Zabbix Servers, click on ‘Next step’ to continue.
As we can see that Zabbix installation is completed successfully.
Installation of the zabbix is now completed & we will be directed to login page, default username is ‘Admin’ and password is ‘zabbix’. Login using the credentials, once logged in we can see the dashboard for the zabbix.
To enable the zabbix server monitoring, goto CONFIGURATION –>> HOSTS. We should only see zabbix server as host, select it & click on ‘Disabled’. It will now be enabled & we than see various monitoring parameters for zabbix server, various graph associated with the server in the monitoring tab.