How To 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.0.155/24
Hostname: server.geniusansh.com
First let us start from server side.
Prerequisites
Before installing Zabbix, we should have install and configure LAMP stack on server.
Zabbix server using commands:
# 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‘admin@123’ .
# 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.


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.20/create/schema/mysql.sql
# mysql -uzabbix -p zabbix < /usr/share/doc/zabbix-server-mysql-1.8.20/create/data/data.sql
# mysql -uzabbix -p zabbix < /usr/share/doc/zabbix-server-mysql-1.8.20/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=admin@123
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.geniusansh.com

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 
-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 the192.168.0.0/24 series.
Alias /zabbix /usr/share/zabbix
Directory "/usr/share/zabbix">
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from 192.168.0.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.
Click Next.
Accept the License agreement.
The installer will check for necessary prerequisites. If everything seems OK, click Next to continue, else go back and install the necessary packages.
Enter the zabbix database name, database user and password and click Test connection. If you entered the correct values, it will show a message that says: OK. Click Next to continue.

Enter your server name and Click Next:
Check the pre-installation summary, if everything good, click Next to continue or click Previous to change the parameters.





Click Next:

Congratulations! You’ve have successfully completed the installation. Click Finish to complete the installation.

Now you’ll be redirected to the zabbix web console page. Enter the username and password. The default username/password is admin/zabbix.
Activate Zabbix server
Initially, the zabbix server is deactivated from being monitored. To activate it, go toConfiguration -> Hosts. Select the host(zabbix server) and choose Activate selectedfrom the drop-down box and click Go.



Check Zabbix server Statistics
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:
 After that you can add Client. then Monitoring you client via Zabbix.

That's IT. Enjoy UR Self with Zabbix!!!

Comments

Popular posts from this blog

Step By Step Configuration Cisco VoIP Phone in Cisco Packet Tracer.

How To Setup Social Publishing CMS (Content Managemnet System) Using Pligg in CentOS 6.5

How To Install And Configuring OpenFire XMPP Chat server on centos 6.5