Install Zabbix Monitoring Tool On CentOS, RHEL, Scientific Linux 6.5
Zabbix is an enterprise-class open source distributed monitoring solution that can be used to monitor and track performance and availability of network servers, devices and other IT resources. It supports distributed and WEB monitoring, auto-discovery, and more.
I tested this how-to On CentOS 6.5, although it should work on other RHEL/CentOS 6.x versions. For the testing purpose, I will use two machines.
Zabbix Server System:
Operating system: CentOS 6.5 IP Address: 192.168.1.101/24 Hostname: server.unixmen.local
Zabbix Client System:
Operating system: Ubuntu 13.04 IP Address: 192.168.1.100/24 Hostname: sk
First let us start from server side.
Before installing Zabbix, we should have install and configure LAMP stack on server. To install and configure LAMP server On Debian 7 and Ubuntu 13.10, refer the following links.
Server Side Configuration
Hence Zabbix is not found in the default repositories, we have to add EPEL repository to install Zabbix. To install EPEL repository, follow the below link:
Now update repository and Zabbix server using commands:
# yum update # yum install zabbix-server-mysql zabbix-agent zabbix-web-mysql
Create MySQL database and user for Zabbix
Let us create a database called ‘zabbix’ and database user called ‘zabbix’ with password ‘centos’.
# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.5.35 MySQL Community Server (GPL) by Remi Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> create database zabbix; Query OK, 1 row affected (0.05 sec) mysql> GRANT ALL ON zabbix.* TO zabbix@localhost IDENTIFIED BY 'centos'; Query OK, 0 rows affected (0.02 sec) mysql> flush privileges; Query OK, 0 rows affected (0.01 sec) mysql> exit Bye
Import zabbix templates to Zabbix database
Let us import the following templates. It will ask you the zabbix password during importing templates.
# mysql -uzabbix -p zabbix < /usr/share/doc/zabbix-server-mysql-1.8.18/create/schema/mysql.sql # mysql -uzabbix -p zabbix < /usr/share/doc/zabbix-server-mysql-1.8.18/create/data/data.sql # mysql -uzabbix -p zabbix < /usr/share/doc/zabbix-server-mysql-1.8.18/create/data/images_mysql.sql
Configure Zabbix server
Edit file /etc/zabbix/zabbix_server.conf,
# vi /etc/zabbix/zabbix_server.conf
Set the database name, user and password which you’ve created earlier. If the lines are commented out, uncomment and set the correct values.
[...] DBName=zabbix [...] DBUser=zabbix [...] DBPassword=centos [...]
Save and close the file.
Edit file /etc/zabbix/zabbix_agentd.conf,
# vi /etc/zabbix/zabbix_agentd.conf
Set the zabbix server hostname.
[...] Hostname=server.unixmen.local [...]
Adjust PHP settings
We should adjust phip.ini file as per zabbix recommended settings.
Edit file php.ini,
# vi /etc/php.ini
Set the values as shown below. If the lines doesn’t exist, add them.
max_execution_time = 600 max_input_time = 600 memory_limit = 256M post_max_size = 32M upload_max_filesize = 16M date.timezone = Asia/Kolkata
Save and close the file.
Adjust Firewall settings
Adjust iptables to allow the zabbix ports 10050 and 10051.
# vi /etc/sysconfig/iptables
Add the following lines:
[...] -A INPUT -m state --state NEW -m tcp -p tcp --dport 10050 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 10051 -j ACCEPT [...]
Restart iptables service to take effect the changes.
# service iptables restart
Allow Zabbix web console for particular IP range (Optional)
Edit file /etc/httpd/conf.d/zabbix.conf,
# vi /etc/httpd/conf.d/zabbix.conf
Add the ip range that you want to allow to access zabbix web interface. This is optional. If you set Allow from All, you can access zabbix from any network. In my case i allowed the 192.168.1.0/24 series.
Alias /zabbix /usr/share/zabbix
<Directory "/usr/share/zabbix"> Options FollowSymLinks AllowOverride None Order allow,deny Allow from 192.168.1.0/24 </Directory>
Save and close the file. Start/Restart zabbix and httpd services and make them to start automatically on every reboot.
# service zabbix-server start # service zabbix-agent start # service httpd restart # service mysqld restart # chkconfig zabbix-server on # chkconfig zabbix-agent on
Access Zabbix Web console
We have completed the installation and configuration part. Now let us setup the zabbix web console. Navigate to http://ip-address/zabbix or http://domain-name/zabbix.
Initially, the zabbix server is deactivated from being monitored. To activate it, go to Configuration -> Hosts. Select the host(zabbix server) and choose Activate selected from the drop-down box and click Go.
After a few seconds, click on the Monitoring tab on the top menu bar and select “Latest data”. You’ll see the zabbix server details:
Client Side Configuration
Let us install zabbix agent on our client systems. To install zabbix client packages on Fedora/RHEL clients, enter the following command in Terminal:
$ sudo yum install zabbix-agent
On Ubuntu/Debian clients:
$ sudo apt-get install zabbix-agent
Next edit file /etc/zabbix/zabbix_agentd.conf,
$ sudo vi /etc/zabbix/zabbix_agentd.conf
Add the server ip address and client hostname.
[...] Server=192.168.1.101 [...] Hostname=sk [...]
192.168.1.101 – CentOS 6.5 IP address(Zabbix server).
sk – Ubuntu 13,04 hostname(client hostname).
Now restart zabbix-agent service with command:
$ sudo service zabbix-agent start
Add Monitoring host
Go to your zabbix server dashboard. To add a monitoring target, navigate to Configuration -> Hosts. Click on Create Host on the right side.
Like us on Facebook
We need your assistance to stay live
This week Top Posts
- Top Things To Do After Installing Ubuntu 13.10 'Saucy Salamander' : Ubuntu 13.10 Saucy Salamander will be released on coming October 17th with many new salient featur...0 comments |
- Fedora 21 Scheduled For Release In October : For Fedora users, just keep calm and use Fedora 20 for now. Fedora Developers has announced that F...1 comment |
- DNS Server Installation Step by Step Using CentOS 6.5/6.4/6.3 : DNS, Domain Name System, translates hostnames or URLs into IP addresses. For example if we type www....0 comments |
- How To Upgrade From Ubuntu 13.04 Raring To Ubuntu 13.10 Saucy Salamander : Ubuntu 13.10 Saucy will be released on October 17th. Hope it will come with lot of improvements and ...0 comments |
- How to use Remote Desktop in Ubuntu : Sometimes, we need to access our computer from other locations when we’re not at home and such. This...0 comments |
- Install LAMP Server (Apache, MySQL or MariaDB, PHP) On Ubuntu 13.10 : Updated January 12, 2014 LAMP is a combination of operating system and open-source software stack. ...0 comments |
- Fedora 21 Scheduled For Release In October
- Install Uget Download Manager In Ubuntu, Fedora, Debian
- Download Elementary OS ‘Luna’ Official Wallpapers
- Install Power Commands 0.1.5 On Ubuntu 14.04/13.10/12.10/12.04
- 5 Android Apps that’s Going to Make Running Your Business Less Stressful
- Puppet agent Install Using Script
- Install Corosync and Pacemaker On CentOS 6.5
- Install Fail2Ban On Ubuntu Server 13.04/13.10
- How To Install Google Chrome in Fedora 20, 19, 18
- How to surf using Tor Browser Bundle
This work by unixmen.com is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
Copyright © 2008-2013 Unixmen.com .