If you’re not familiar with linux or open source tools, finding all the dependencies, downloading the source, compiling source, creating the db, etc can be a daunting task. So I’ve created this cut and paste walk through to help you through those steps. Almost everything here is cut and paste, except for hostname, and password information :) You’ll need to provide those on your own. I’ve done my best to make this as accurate as possible. I hate walkthroughs that just aren’t accurate! CentOS was installed choosing zero options, with as base of an installation as it would let me. I used the 2.6.18-8 kernel. If you have any questions, or find any errors, please let me know. And of course as usual, if you find it helpful, also, please let me know :)
I wrote these instructions using 1.4.1 as the example, but theres no reason why 1.4.2 shouldn’t work the same way :)
Update, 11/4/2007: 1.4.2 seems to install its binaries under prefix/sbin instead of prefix/bin, which is different than 1.4.1 which was used for this document. I’ve also noticed that when copying and pasting from this guide some of the whitespace, apostrophies, and dashes (‘ – ) seem to get distorted upon pasting. Its correct in the source, but when its displayed something is munged up. When I figure out what it is, I’ll fix it. In the meantime if you get a syntax error, try retyping what I’ve put on this page instead of copying and pasting. And if you know why its happening, let me know! :)
Install all the necessary pieces. I started with a very base installation of CentOS 5.
yum -y install ntp php php-bcmath php-gd php-mysql httpd mysql gcc mysql-server mysql-devel net-snmp net-snmp-utils net-snmp-devel net-snmp-libs curl-devel mak
Start up the time server. its important for the time between your devices to be in sync.
Download fPing, and install it:
rpm -Uvh fping-2.4-1.b2.2.el5.rf.i386.rpm
chmod 7555 /usr/sbin/fping
Create Zabbix user.
Download zabbix and untar it.
tar -xzvf zabbix-1.4.1.tar.gz
Start MySQL, and change the root password.
/usr/bin/mysqladmin -u root password YourFancyNewRootPassword
Connect to the DB using your newly created root password. Create the zabbix DB, and assign a new user (zabbixmysqluser) with privileges to that DB. You may want to change “zabbixmysqlpassword” to something else. But it should not be the same as any other “critical” password because it will be stored plain text in a config file.
mysql -u root -p
mysql> CREATE DATABASE zabbix;
mysql> GRANT DROP,INDEX,CREATE,SELECT,INSERT,UPDATE,ALTER,DELETE ON zabbix.* TO zabbixmysqluser@localhost IDENTIFIED BY ‘zabbixmysqlpassword';
Create the DB Schema
cat create/schema/mysql.sql | mysql -u zabbixmysqluser -pzabbixmysqlpassword zabbix
cat create/data/data.sql | mysql -u zabbixmysqluser -pzabbixmysqlpassword zabbix
cat create/data/images_mysql.sql | mysql -u zabbixmysqluser -pzabbixmysqlpassword zabbix
./configure –enable-server –prefix=/usr/local/zabbix –with-mysql –with-net-snmp –with-libcurl
Compile the agent. I chose to compile it staticly, so it can be copied easily to other hosts.
./configure –enable-agent –prefix=/usr/local/zabbix –enable-static
Add the zabbix server and agent ports to your /etc/services file.
echo ‘zabbix_agent 10050/tcp’ >> /etc/services
echo ‘zabbix_trap 10051/tcp’ >> /etc/services
Copy the sample configs to /etc/zabbix for server and agentd.
cp misc/conf/zabbix_agentd.conf /etc/zabbix
cp misc/conf/zabbix_server.conf /etc/zabbix
in /etc/zabbix/zabbix_server.conf, modify:
in /etc/zabbix/zabbix_agentd.conf, modify:
cp misc/init.d/redhat/zabbix_agentd_ctl /etc/init.d/zabbix_agentd
cp misc/init.d/redhat/zabbix_server_ctl /etc/init.d/zabbix_server
in /etc/init.d/zabbix_agentd AND /etc/init.d/zabbix_server:
in /etc/init.d/zabbix_agentd (Note the # hash marks, they are necessary), add near the top, just below #!/bin/sh:
# chkconfig: 345 95 95
# description: Zabbix Agentd
in /etc/init.d/zabbix_server (again, note the # Hash marks, they are required), add near the top, just below #!/bin/sh:
# chkconfig: 345 95 95
# description: Zabbix Server
Configure automatic starting and stopping of services.
chkconfig –level 345 zabbix_server on
chkconfig –level 345 zabbix_agentd on
chkconfig –level 345 httpd on
chkconfig –level 345 mysqld on
chkconfig –level 0123456 iptables off
Note: I turn the iptables firewall OFF because my box is behind a firewall. You should consult with your network folks before turning off the firewall. At the very least you should poke holes for port 80, 10050, and 10051 in the firewall.
cp -r frontends/php /var/www/html/zabbix
in /etc/php.ini, modify:
max_execution_time = 300
date.timezone = America/Los_Angeles
Note: Obviously you should substitute your own time zone. For a list of all valid timezones, click here
chmod 777 /var/www/html/zabbix/conf
Launch http://your.servers.name/zabbix inyour browser. You should be prompted with a setup screen. Click through the user agreement, and when you get to the Pre requisites screen, make sure you have a green OK next to everything.
When you’ve finished walking through the web interface setup:
chmod 755 /var/www/html/zabbix/conf
mv /var/www/html/zabbix/setup.php /var/www/html/zabbix/setup.php.bak
You can now login to your zabbix installation by going to http://your.server.name/zabbix, using the username “admin”, with no password. To monitor your zabbix server, you can go to the Configuration Tab, and choose the “hosts” sub Tab. Select the “Zabbix Server” host, by putting a checkmark next to it. and choose the “Activate Selected” button below. Wait a minute or two, then select the “Monitoring” tab, and then the “latest data” sub tab. You should start seeing performance stats appear!
For Reference, your binaries are under /usr/local/zabbix/bin, and your configuration files are in /etc/zabbix.
I’m not a big fan of their default template, I think the naming sucks. Look for a future article talking about renaming zabbix items. But this should be enough to get you started! :) You can find the answers to most of your questions in the Zabbix manual, available here: http://www.zabbix.com/documentation.php . You can also find lots of answers in the zabbix forums .