====== Installing Zabbix 1.8 on Debian 5.0.3 from Source ====== The instructions apply to installation of Zabbix v1.8.x from sources under Debian 5.0.x but may apply to other versions. These instructions are based on materials related to installation of Zabbix under Ubuntu. ===== Preparing your system ===== Install Debian base system without any additional packages. Install pre-requisites: apt-get install openssh-server # It is not required for Zabbix, but makes remote work with Debian system possible apt-get install postgresql-8.3 # PostgreSQL 8.3 server apt-get install build-essential # GCC compiler, linker, libraries, etc apt-get install fping # Fping binary for ICMP pings apt-get install apache2 # Apache WEB server apt-get install libsnmp-dev # Net-SNMP libraries apt-get install libcurl4-openssl-dev # Curl libraries for WEB monitoring apt-get install libapache2-mod-php5 # PHP5 module for Apache apt-get install php5-gd # PHP module for graphs apt-get install php5-pgsql # PHP module for PostgreSQL apt-get install libiksemel-dev # Libraray for Jabber messaging apt-get install libssh2-1-dev # For agent-less SSH checks apt-get install libpq-dev # PostgreSQL development files ===== Installing and Configuring Zabbix ===== **1 - Make the zabbix user and group:** sudo adduser zabbix enter in new password confirm use the remaining defaults. **2 - Download and Untar the sources:** su - zabbix wget http://optusnet.dl.sourceforge.net/sourceforge/zabbix/zabbix-1.8.tar.gz tar xfzv zabbix-1.8.tar.gz You might want to confirm that this is actually the latest version. You might also want to find a mirror closer to you by going to http://sourceforge.net/project/showfiles.php?group_id=23494. **3 - Create a zabbix database and populate it:** As user 'postgres': psql > create user zabbix createdb password 'secretpassword'; > \quit The following steps will require the password you assigned to the new zabbix database user account in the step above. As user 'zabbix': echo "create database zabbix"|psql template1 cat zabbix-1.8/create/schema/postgresql.sql |psql zabbix cat zabbix-1.8/create/data/data.sql |psql zabbix cat zabbix-1.8/create/data/images_pgsql.sql |psql zabbix Ignore warnings if there are any. **4 - Configure, compile and install the server:** cd zabbix-1.8 ./configure --enable-server --enable-agent --with-pgsql --with-net-snmp --with-libcurl --with-jabber --prefix=/tmp make su # Enter root password make install **5 - Prepare the rest of the system:** sudo nano /etc/services Add at the end: zabbix_agent 10050/tcp # Zabbix ports zabbix_trap 10051/tcp Save and exit. sudo mkdir /etc/zabbix sudo chown -R zabbix.zabbix /etc/zabbix/ cp misc/conf/zabbix_* /etc/zabbix/ Edit /etc/zabbix/zabbix_agentd.conf: nano /etc/zabbix/zabbix_agentd.conf Make sure that the Server parameter points to the server address, for the agent that runs on the server it is like this: Server=127.0.0.1 Save and exit. Edit /etc/zabbix/zabbix_server.conf: nano /etc/zabbix/zabbix_server.conf For small sites this default file will do, however if you are into tweaking your config for your 10+ hosts site, this is the place. Change this: # Database user DBUser=zabbix # Database password # Comment this line if no password used DBPassword=Secret Save and exit. Copy the init.d scripts to the right spot: sudo cp misc/init.d/debian/zabbix-server /etc/init.d sudo cp misc/init.d/debian/zabbix-agent /etc/init.d You may need to edit these script files as the compiled versions of the zabbix files is placed under /usr/sbin (/usr/bin in older versions). sudo nano /etc/init.d/zabbix-server Look for the following line: DAEMON=/home/zabbix/bin/${NAME} and replace it with: DAEMON=/usr/sbin/${NAME} (old versions use /usr/bin/${NAME}) Save and exit. sudo nano /etc/init.d/zabbix-agent Look for the following line: DAEMON=/home/zabbix/bin/${NAME} and replace it with: DAEMON=/usr/sbin/${NAME} (old versions use /usr/bin/${NAME}) Save and exit. Now set the correct permissions and set ZABBIX to start when the machine boots: sudo chmod 755 /etc/init.d/zabbix-server sudo update-rc.d zabbix-server defaults sudo chmod 755 /etc/init.d/zabbix-agent sudo update-rc.d zabbix-agent defaults Start the server : sudo /etc/init.d/zabbix-server start Start the agent: sudo /etc/init.d/zabbix-agent start Now check to make sure that they are running: ps -aux | grep zabbix You should see multiple instances of zabbix_server and zabbix_client running if everything has gone ok. **6 - Configure web interface** As user 'root': cd /var/www rm index.html cp -R /home/zabbix/zabbix-1.8/frontends/php/* . Make php.ini adjustments: sudo nano /etc/php5/apache2/php.ini Change the following values: max_execution_time = 300 ; Maximum execution time of each script, in seconds date.timezone = America/Kentucky/Louisville (use this url to find your correct timezone format: http://us3.php.net/manual/en/timezones.php ) Restart Apache: sudo /etc/init.d/apache2 restart ===== Web Interface Configuration ===== Now point your browser to: http:///zabbix/ **1. Introduction** read and click Next **2. License Agreement** Read, check 'I Agree', click Next **3. Check of Pre-Requisites** Fix any problems, click retry. Click Next when all pre-requisites are OK. **4. Configure DB Connection** Enter appropriate settings and click Test Connection. Click Next when OK. **5. Pre-Installation Summary** Verify installation settings, click Next. **6. Install** Click Save Configuration file and save to machine. Copy zabbix.conf.php to /home/zabbix/public_html/conf/zabbix.conf.php One way to do this from a desktop machine (requires ssh installed): scp zabbix.conf.php zabbix@:/home/zabbix/public_html/conf/ If using a windows workstation, you can use winscp [[http://winscp.net/eng/index.php]] to drag/drop the file onto your zabbix machine. This also requires ssh to be installed. (sudo apt-get install openssh-server) Click Retry and click Next when OK. **7. Finish ** Click Finish to complete installation. Your New Zabbix install will now be shown. Log in with username: Admin No Password First go to the tab Configuration and then Hosts. Now create a host-group, see that you can give it some templates, e.g: Application.MySQL, Host.SNMP, Host.Standalone, Host.Unix. Then some hosts: Select your host-group and use Link with Template Host.Unix Now a lot of triggers are imported and the game begins. Go to the monitoring tab and watch the latest values roll in. For specifics on configuration, please refer to the Zabbix user manual.