As promised from my previous post on Installing CentOs on VirtualBox, this post will be focused on simple step by step installation guide of Zabbix monitoring tool on CentOS. As of the writing of this post, Zabbix v2.0 and CentOS v6.4 where the latest. It is assumed that you already have CentOS 6.4 installed and configured.
Setup:
1. Install repository configuration package:
- # rpm -ivh http://repo.zabbix.com/zabbix/2.0/rhel/6/x86_64/zabbix-release-2.0-1.el6.noarch.rpm
2. Install Zabbix server and web front-end with mysql:
- # yum install zabbix-server-mysql zabbix-web-mysql
Note: Enter Y during each prompt to install the packages
3. Install MySQL Database: Select Y/N as desired during each prompt and set your new root password
- # yum install mysql-server service mysqld start mysql_secure_installation
4. Create zabbix database:
- # mysql -uroot -p<enter new root password>;
- mysql> create database zabbix character set utf8;
- mysql> grant all privileges on zabbix.* to zabbix@localhost identified by ‘zabbix’;
- mysql> exit
5. Import initial schema and data:
- # cd /usr/share/doc/zabbix-server-mysql-2.0.6/create
- # mysql -uroot -p<enter password> zabbix < schema.sql
- # mysql -uroot -p<enter password> zabbix < images.sql
- # mysql -uroot -p<enter password> zabbix < data.sql
6. Edit database configuration in zabbix_server.conf:
- # vi /etc/zabbix/zabbix_server.conf
Confirm following lines:
– DBHost=localhost (uncomment this line)
– DBName=zabbix
– DBUser=zabbix
– DBPassword=zabbix (uncomment this line)
7. Start Zabbix server service:
- # service zabbix-server start
8. Change Timezone:
- # vi /etc/httpd/conf.d/zabbix.conf
Uncomment below line and change to desired timezone
- # php_value date.timezone Europe/London
9. Restart the apache web server:
- # service httpd restart
10. Set zabbix services to start on reboot:
- # chkconfig zabbix-server on
- # chkconfig mysqld on
- # chkconfig httpd on
11. Configure Zabbix Web interface:
- At this stage, Zabbix web interface should be accessible by browsing ‘http://<zabbix server hostname>/zabbix‘
Note: If you are unable to browse the site, check the following troubleshooting steps:
- Check system is listening on port 80:
- Edit httpd.conf file via this command ‘vi /etc/httpd/conf/httpd.conf‘, locate the line Listen and ensure it has 0.0.0.0:80
- Disable iptables firewall:
- Run the command ‘service iptables stop‘ to stop the service and use ‘service iptables status‘ to confirm its not running
- Click Next and make sure all checks are OK
- Enter the database password and click Test connection. Make sure connection is established
- Enter desired name, leave port same
- Confirm all settings are right
- Click Finish to complete configuration
Log into zabbix with default credentials (u: Admin, P: zabbix) and there you are a nice looking shiny HomePage
- Click profile on top right hand corner, click Change password and complete the change password process
There we are all done . I will in future posts show us how to install zabbix agent on servers and configure monitoring of critical services on servers including alerting. Stay tuned…