October 29, 2009 · Monitoring, Server · Email This Post

Sponsored Link
ZABBIX is an enterprise-class distributed monitoring solution designed to monitor and track performance and availability of network servers, devices, and other IT resources. It supports distributed and Web-based monitoring, auto-discovery, real-time monitoring, SLA assurance, trending, and more.
Key features

* Open Source solution
* Runs on AIX, FreeBSD, HP-UX, Linux, MacOS X, NetBSD, OpenBSD, Solaris, Tru64/OSF
* SQL database for storing configuration, collected data and trends
* Web interface offers minimal learning, ubiquitous access
* Instant drill down from real-time status of IT Services to historical trend and statistics
* Data visualisation and mapping
* High performance native ZABBIX agents for performance and integrity monitoring for virtually all platforms (UNIX, Win32)
* Monitoring of "agentless" environments
* Assuring and monitoring SLA for IT Services
* Monitoring of SNMP (v1,v2,v3) devices

Install Zabbix 1.6.6 in Ubuntu 9.04 (Jaunty) Server

This tutorial will assume you have install Ubuntu 9.04 server installed and also you have installed all the up to date packages.

Preparing your server

Install the required packages

sudo apt-get install build-essential gnustep-make

sudo apt-get install linux-headers-$(uname -r)

sudo apt install ntp ntp-simple ntpdate

Now you need to edit /etc/ntp.conf file and change your NTP servers after that restart ntp using the following comamnd

sudo /etc/init.d/ntp restart

Now you need to create zabbix user with the following comamnd

sudo adduser zabbix

enter your password

Now you need to login as zabbix user

sudo su zabbix

Install the following packages

sudo apt-get install apache2

sudo apt-get install postgresql-8.3 postgresql-server-dev-8.3

sudo apt-get install php5 php5-gd php5-pgsql snmp libsnmp-dev snmpd libcurl4-openssl-dev fping libiksemel3 libiksemel-dev

Install postgresql web GUI admin application using the following command

sudo apt-get install phppgadmin

Now you need to login as root

sudo su -

sudo -u postgres psql postgres
\password postgres
password123
\q; ubuntu and Postgres Usernames (both = zabbix) are the same so they can work in unison

sudo -u postgres createuser --superuser zabbix

sudo -u postgres createdb zabbix

Now you can login to psql without sudo

Now you need to login as zabbix user

sudo su zabbix

cd /home/zabbix

Download zabbix latest version from here (At the time of writing this article version 1.6.6)

tar zxvpf zabbix-1.6.6.tar.gz

cd zabbix-1.6.6/create/schema

cat postgresql.sql | psql zabbix

cd ../data

cat data.sql | psql zabbix

cat images_pgsql.sql | psql zabbix

cd ..

cd ..

sudo ./configure --enable-server --enable-agent --with-pgsql --with-net-snmp --with-jabber=/usr/ --with-libcurl

sudo make install

Now you need to add the following ports to services file

sudo nano /etc/services

Add at the following ports

zabbix_agent 10050/tcp
zabbix_trap 10051/tcp

Save and exit the file

sudo mkdir /etc/zabbix

sudo chown -R zabbix.zabbix /etc/zabbix/

cp misc/conf/zabbix_* /etc/zabbix/

Now we need to edit the agent config file

nano /etc/zabbix/zabbix_agentd.conf

Make sure that the Server parameter points to the server ip address, for the agent that runs on the

server it is like this: Server=127.0.0.1 change to xxx.xxx.xxx.xxx

AND REMOVE # from ListenIP=127.0.0.1 AND CHANGE IT to ListenIP=xxx.xxx.xxx.xxx

Save and exit the file

Now we need to edit the server config file

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=password123

AND REMOVE # from ListenIP=127.0.0.1 AND CHANGE IT to ListenIP=X.X.X.X (your server ip)

Save and exit the file

Now copy the zabbix server,agent startup scripts for  to /etc/init.d location

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

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

Now we need to change of destination path in server and agent configuration files

For zabbix server config file

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}

For zabbix server config file

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}

Save and exit the file

Add the zabbix server and agent config files to startup

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

Now you can start zabbix server and agent using the following command

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

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

You can check the processes using the following command

ps -aux | grep zabbix

cd /home/zabbix/zabbix-1.6.6/

mkdir /home/zabbix/public_html

cp -R frontends/php/* /home/zabbix/public_html/

Now we need to edit the default apache configuration file

sudo nano /etc/apache2/sites-enabled/000-default

Change the following section

DocumentRoot /var/www
<Directory />

Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>

With this

DocumentRoot /home/zabbix/public_html
<Directory /home/zabbix/public_html>
AllowOverride FileInfo AuthConfig Limit Indexes
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
<Limit GET POST OPTIONS PROPFIND>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS PROPFIND>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>

Change php.ini file memory limit and time settings

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 = Europe/Copenhagen

Allow postgres user to access webadmin console to do this edit

/usr/share/phppgadmin/conf/config.inc.php,/etc/phppgadmin/apache.conf files

sudo nano /usr/share/phppgadmin/conf/config.inc.php

CHANGE:

$conf['extra_login_security'] = true;

TO:

$conf['extra_login_security'] = false;

sudo nano /etc/phppgadmin/apache.conf

CHANGE:

deny from all

TO:

allow from all

Restart apache server using the following command

sudo /etc/init.d/apache2 restart

Now you need to point your browser http://serverip login using admin as users with zabbix password

In ZABBIX: Configuration / Hosts / Zabbix server should be yourserver ip instead of for 127.0.0.1

Log on to PostGreSQL Web-Admin console : http://serverip/phppgadmin

Using postgres user with password123 (password)

Problem

When you try to start zabbix server and agent you are not able to see anything is started or not working

Solution

Check that the files are in: /usr/sbin

Otherwise LOG IN as root

cp /home/zabbix/zabbix-1.6.6/src/zabbix_agent/zabbix_agent /usr/sbin/

cp /home/zabbix/zabbix-1.6.6/src/zabbix_agent/zabbix_agentd /usr/sbin/

cp /home/zabbix/zabbix-1.6.6/src/zabbix_get/zabbix_get /usr/sbin/

cp /home/zabbix/zabbix-1.6.6/src/zabbix_sender/zabbix_sender /usr/sbin/

cp /home/zabbix/zabbix-1.6.6/src/zabbix_server/zabbix_server /usr/sbin/

/etc/init.d/zabbix-server start

/etc/init.d/zabbix-agent start

ps aux | grep zabbix ; check running zabbix services

LOG FILES for TroubleShooting

/tmp/zabbix_server.log

/tmp/zabbix_agentd.log

/var/log/daemon.log

/var/log/auth.log

Sponsored Link

Incoming search terms:

Related posts

12 Comments to “How to setup Zabbix monitoring application in Ubuntu 9.04 (Jaunty) Server”

  1. codedmind says:

    Hy there!

    I do every step, and i have zabbix running however when i open webgui i don’t have any graph but have this line
    Number of hosts (monitored/not monitored/templates) 43 0 / 1 / 42

    Everything is empty…

    [Reply]

    admin Reply:

    Check the logs menctioned in the article and check all the required processes are running

    [Reply]

  2. codedmind says:

    I have done that, everything is up and running!

    i already install agents in others computers but no juice

    [Reply]

  3. How does one set-up alerting people for systems that go down via Jabber? I need users to have their jabber pop at them if server goes offline. Thanks so much. Cheers. Peace. Thanks again.

    [Reply]

  4. orionweb says:

    sudo apt install ntp ntp-simple ntpdate
    should be
    sudo apt-get install ntp ntp-simple ntpdate

    [Reply]

  5. orionweb says:

    oh and ntp-simple doesn’t exist anymore it just reference ntp so that bit can be removed

    sudo apt-get install ntp ntpdate

    [Reply]

  6. Zabbed says:

    Hello All, thanks for this great tutorial. I used this to install Zabbix 1.8. Everything appears to work as expected except for my Web Scenarios. I see under state Idle till 31 Dec 1969 16:00:00, Last Check 31 Dec 1969 16:00:00
    Status Unknown.
    Any idea what is going on?

    Thank you for any input

    [Reply]

  7. Zabbed says:

    Looks like it might be because php5-curl is not installed

    [Reply]

  8. Zabbed says:

    Hmm, still does work

    [Reply]

  9. Zabbed says:

    Ouch, after checking zabbix server logs I found the problem. there was a locked pid even after rebooting.

    [Reply]

  10. Cameron says:

    This is about the sixth “zabbix howto” I’ve seen that ends with installation. How about adding a few words about making it DO SOMETHING? We’re all poking around our empty admin GUIs now, wondering how you define a real event, and how do you define a trigger on that event, and how to you make the trigger take an action. It seems like there’s something missing between installation and the exhaustive syntax reference in the official manual. Details are wonderful, but an overview would help more.

    [Reply]

  11. skadzo says:

    I followed this tutorial to the letter and have
    “Zabbix server is running : No” on the dashboard… i cannot seem to get this working :/ any idea’s?

    @Cameron i believe from the zabbix server you need to run something like this: snmpwalk -v1 -c -m ALL .1 then use the output from there to pretty much define an item or trigger. haven’t exactly got there but from what i’ve read on the net.

    [Reply]

Leave a Reply