/ Linux

Installing Zabbix 1.8.x on Ubuntu Lucid 10.04

A quick step by step guide to get Zabbix running. A newer version for Ubuntu 12.04 and Zabbix 2 can be found here. First make sure Apache, MySQL and PHP are installed

sudo apt-get install apache2 apache2-mpm-prefork php5 mysql-client mysql-server php5-gd php5-mysql

Edit /etc/php5/apache2/php.ini and make the following adjustments

memory_limit = 256M post_max_size = 32M upload_max_filesize = 16M max_execution_time = 600 max_input_time = 600 date.timezone = UTC

Restart Apache so that the new PHP configuration is activated

sudo /etc/init.d/apache2 restart

Install required packages to compile Zabbix

sudo apt-get build-dep zabbix-server-mysql

Download the Zabbix sources from www.zabbix.com. Extract the archive.

tar xzf zabbix-1.8.7.tar.gz

Enter the directory and compile the software

cd zabbix-1.8.7 ./configure --prefix=/usr --with-mysql --with-net-snmp --with-openipmi --with-jabber --with-libcurl --enable-server --enable-agent make sudo make install

Create a new MySQL user and database

mysql -u root -p mysql> create database zabbix character set utf8; mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'yourpassword'; mysql> quit;

Import the default Zabbix database and configuration

mysql -u zabbix -p zabbix < create/schema/mysql.sql mysql -u zabbix -p zabbix < create/data/data.sql mysql -u zabbix -p zabbix < create/data/images_mysql.sql

Create the Zabbix configuration directory

mkdir /etc/zabbix

Copy the server and agent configuration files

sudo cp misc/conf/zabbix_server.conf /etc/zabbix/ sudo cp misc/conf/zabbix_agentd.conf /etc/zabbix/

Make the following changes to the etc/zabbix/zabbix_server.conf configuration file

LogFile=/var/log/zabbix-server/zabbix_server.log PidFile=/var/run/zabbix-server/zabbix_server.pid DBUser=zabbix DBPassword=yourpassword

Make the following changes to the /etc/zabbix/zabbix_agentd.conf configuration file

LogFile=/var/log/zabbix-agent/zabbix_agentd.log PidFile=/var/run/zabbix-agent/zabbix_agentd.pid

Copy the server and agent startup scripts

sudo cp misc/init.d/debian/zabbix-server /etc/init.d/ sudo cp misc/init.d/debian/zabbix-agent /etc/init.d/

Make the following changes to the server startup script /etc/init.d/zabbix-server:

DAEMON=/usr/sbin/${NAME} PID=/var/run/zabbix-server/$NAME.pid

And in the same file underneath echo “Starting $DESC: $NAME” also add

if test ! -d $(dirname $PID); then mkdir $(dirname $PID) chown -R zabbix:zabbix $(dirname $PID) fi

Make the following changes to the agent startup script /etc/init.d/zabbix-agent:

DAEMON=/usr/sbin/${NAME} PID=/var/run/zabbix-agent/$NAME.pid Undernneath  echo "Starting $DESC: $NAME" add if test ! -d $(dirname $PID); then mkdir $(dirname $PID) chown -R zabbix:zabbix $(dirname $PID) fi

Create a zabbix user and group

sudo addgroup --system zabbix $sudo adduser --system --disabled-login --ingroup zabbix --home /var/run/zabbix-server --no-create-home zabbix

Create a folder for the server and agent log files und process ids.

sudo mkdir /var/log/zabbix-server sudo chown zabbix:zabbix /var/log/zabbix-server sudo mkdir /var/run/zabbix-server sudo chown zabbix:zabbix /var/run/zabbix-server sudo mkdir /var/log/zabbix-agent sudo chown zabbix:zabbix /var/log/zabbix-agent sudo mkdir /var/run/zabbix-agent sudo chown zabbix:zabbix /var/run/zabbix-agent

Enable log rotation for the server log files by creating a file /etc/logrotate.d/zabbix-server with the following content:

/var/log/zabbix-server/zabbix_server.log { daily rotate 7 compress missingok notifempty create 0640 zabbix zabbix sharedscripts }

Enable log rotation for the server log files by creating a file /etc/logrotate.d/zabbix-agent with the following content:

/var/log/zabbix-agent/zabbix_agentd.log { daily rotate 7 compress missingok notifempty create 0640 zabbix zabbix sharedscripts }

Start the zabbix server

sudo /etc/init.d/zabbix-server start

Start the zabbix agent

sudo /etc/init.d/zabbix-agent start

Make sure both server and agent start automatically at startup.

sudo update-rc.d zabbix-server defaults 98 02 sudo update-rc.d zabbix-agent defaults 98 02

Copy the webserver files

sudo rm /var/www/index.html sudo cp -r frontends/php/* /var/www/

Point a web browser to your server address and follow the instructions of the Zabbix frontend installation wizard.

You can then enter the web interface using the username admin and the password zabbix. Change it immediately.

http://www.zabbix.com/download.php
http://www.zabbix.com/documentation/1.8/manual/installation

Troubleshooting

Zabbix wrongly reports ‘apache is not running’.
Zabbix by default checks for a process called http but for Ubuntu it should be apache2 instead. Just go to Configuration > Templates. Find the line Template_Linux, click on Items, then Number of running processes apache and change proc.num[httpd] to proc.num[apache2]. The trigger will be updated automatically.

Zabbix reports ‘Syslogd is not running’.
In Ubuntu 9.10 and later the sysklogd package has been replaced with rsyslog. Go to Configuration > Templates > Template_Linux > Number of running processes syslogd and change proc.num[syslogd] to proc.num[rsyslogd]. You might also want to update the description field for the item and trigger.

**Zabbix inventory is empty
**Hosts do not automatically appear in the inventory but only if you have checked the box Use Profile when setting them up. You can do this later by going to Configuration > Hosts and clicking on the name of the host; then activate Use profile and fill out some of the fields.

Installing Zabbix 1.8.x on Ubuntu Lucid 10.04
Share this