Zabbix can be extremely useful for monitoring and trouble shooting. It is my weapon of choice for monitoring Linux and network devices. This brief tutorial covers the steps i went through in order to get the latest release of Zabbix installed on Centos 5.5 (i386). I have not mastered SE Linux yet so this tutorial assumes that SE Linux is disabled.
Log on as root
Prerequisites
yum install php php-gd install php-xml php-mysql php-bcmath php-mbstring make gcc curl curl-devel mysql-devel gnutls-devel net-snmp-devel
Start / restart Apache so the PHP modules are active
/etc/init.d/httpd restart
Start MySQL and run mysql_secure_installation
/etc/init.d/httpd start mysql_secure_installation
Download the source
cd ~ wget http://voxel.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/1.8.6/zabbix-1.8.6.tar.gz
Extract the files files
tar -xzf zabbix-1.8.6.tar.gz
Browse http://pkgs.repoforge.org/iksemel/ for the correct version of iksemel
I used
wget http://pkgs.repoforge.org/iksemel/iksemel-devel-1.4-1.el5.rf.i386.rpm wget http://pkgs.repoforge.org/iksemel/iksemel-1.4-1.el5.rf.i386.rpm rpm -ivh iksemel-1.4-1.el5.rf.i386.rpm iksemel-devel-1.4-1.el5.rf.i386.rpm
Create Zabbix user and group if it does not exist
/usr/sbin/groupadd zabbix /usr/sbin/useradd -c 'Zabbix' -g zabbix -s /dev/null zabbix
Create zabbix mysql user.
mysql -u<username> -p<password>
CREATE USER `zabbix`@'%' IDENTIFIED BY 'zabbix';
Note: Security could be tightened by replacing % with localhost or the loopback address.
Setup database
CREATE DATABASE zabbix CHARACTER SET utf8; GRANT ALL ON `zabbix`.* TO 'zabbix'@'%'; FLUSH PRIVILEGES; quit;
Create the zabbix db
cd /root/zabbix-1.8.6/create/schema/ cat mysql.sql | mysql -u zabbix -pzabbix zabbix cd ../data/ cat data.sql | mysql -u zabbix -pzabbix zabbix cat images_mysql.sql | mysql -u zabbix -pzabbix zabbix
Change back to the root of the Zabbix download
cd ../../
Run configure and make install
./configure --enable-server --enable-agent --with-mysql --with-net-snmp --with-jabber --with-libcurl make install
Add the agent services to the end of /etc/services
vi /etc/services
Add these lines to the end
zabbix-agent 10050/tcp Zabbix Agent zabbix-agent 10050/udp Zabbix Agent zabbix-trapper 10051/tcp Zabbix Trapper zabbix-trapper 10051/udp Zabbix Trapper
Create Zabbix conf directory
mkdir /etc/zabbix
Copy agent and server config files
cp /root/zabbix-1.8.6/misc/conf/zabbix_agentd.conf /etc/zabbix/zabbix_agentd.conf cp /root/zabbix-1.8.6/misc/conf/zabbix_server.conf /etc/zabbix/zabbix_server.conf
Modify Zabbix server configuration and set appropriate value for DBPassword and DBUser. zabbix_agentd.conf is fine.
cd /etc/zabbix/ vi zabbix_server.conf </pre Adjust these values like so <pre> DBUser=zabbix DBPassword=zabbix
Create startup script
cp /root/zabbix-1.8.6/misc/init.d/redhat/8.0/zabbix_server /etc/init.d/ chmod +x /etc/init.d/zabbix_server cp /root/zabbix-1.8.6/misc/init.d/redhat/8.0/zabbix_agentd /etc/init.d/ chmod +x /etc/init.d/zabbix_agentd
Edit progdir in /etc/init.d/zabbix_server and /etc/init.d/zabbix_agentd
vi /etc/init.d/zabbix_server vi /etc/init.d/zabbix_agentd progdir="/usr/local/sbin/"
Test start and stop commands.
/etc/init.d/zabbix_agentd start /etc/init.d/zabbix_agentd stop /etc/init.d/zabbix_server start /etc/init.d/zabbix_server stop
Make sure you leave Zabbix in a started state.
/etc/init.d/zabbix_agentd start /etc/init.d/zabbix_server start
Make zabbix server and agent start at reboot
chkconfig zabbix_agentd on chkconfig zabbix_server on
Setup the web interface
mkdir /var/www/html/zabbix cd /root/zabbix-1.8.6/frontends/php/ cp -a . /var/www/html/zabbix/ chown -R apache.apache /var/www/html/zabbix
Edit php.ini
vi /etc/php.ini
Set date.timezone to your time zone.
date.timezone = "America/New_York"
Some other php settings
post_max_size = 16M max_execution_time = 300 max_input_time = 600
Restart Apache so the php modules are active and the config changes take effect
/etc/init.d/httpd restart
Browse to your webserver/zabbix/ and complete the install. The default logon is admin and password is zabbix.
http://<your_ip>/zabbix
10:14, 2011/12/10Irene /
Great article, thank you again for wriitng.