Bobcares

Monitor Your Network with Zabbix Monitoring Solution : Installation HOWTO

by | Feb 18, 2009

A Web Host has to actively monitor all the services running on each of its Internet Servers. Customers assume that the services advertised by the host are available 24/7, and hence Internet servers monitoring takes a high priority in the Web Hosting business world. A Web Host can be sure that all promises are being kept through an effective server monitoring system. A software installed on one server which can remotely monitor your Internet servers becomes the best solution. There are Commercial and Free options.

 

Hire Bobcares Linux Server Administrators
Get super reliable servers and delighted customers

See how we do it!

 

 

Zabbix, which has both free and commercial support, is a high-class open source distributed monitoring solution. Zabbix is a network management system application used to monitor and track the status of various network services, the server health and integrity, and other network hardware. It also allows support to configure e-mail alerts for an event which will help them to quickly react to any server problem. Zabbix has a very good graphic visualization and it plays an important role in monitoring a small batch or a multitude of servers.

In order to store data, Zabbix uses MySQL, PostgreSQL, SQLite or Oracle database engine. This article deals with the Installation and access mechanism of Zabbix.

Table of Contents

  1. Installation of Zabbix
  2. Zabbix Monitoring System Access
  3. Conclusion

1. Installation of Zabbix

As a pre-requisite, make sure that you have the following packages installed on your machine.

http, mysql, gcc, mysql-server, mysql-devel, net-snmp, net-snmp-utils, net-snmp-devel, net-snmp-libs, curl-devel, mak, ntp, php – with bcmath, gd and mysql support

You can use the Yum installer to install the above packages.
yum -y install package-name

Startup the time server for syncing the time between devices:
/etc/init.d/ntpd start

Download and Install fPing –

wget http://dag.wieers.com/rpm/packages/fping/fping-2.4-1.b2.2.el5.rf.i386.rpmrpm -Uvh fping-2.4-1.b2.2.el5.rf.i386.rpmchmod 7555 /usr/sbin/fping

Create Zabbix user –

useradd zabbix

Download Zabbix and Untar it –

wget http://jaist.dl.sourceforge.net/sourceforge/zabbix/zabbix-1.4.4.tar.gztar -xzvf zabbix-1.4.4.tar.gz

Grant zabbix database access to the corresponding user –

mysql -u root -pmysql> CREATE DATABASE zabbix;mysql> GRANT DROP,INDEX,CREATE,SELECT,INSERT,UPDATE,ALTER,DELETE ON zabbix.*TO zabbixmysqluser@localhost IDENTIFIED BY 'zabbixmysqlpass';

Create the DB Schema –

cd zabbix-1.4.4cat create/schema/mysql.sql | mysql -u zabbixmysqluser -pzabbixmysqlpass zabbixcat create/data/data.sql | mysql -u zabbixmysqluser -pzabbixmysqlpass zabbixcat create/data/images_mysql.sql | mysql -u zabbixmysqluser -pzabbixmysqlpass zabbix
Zabbix has a very good graphic visualization and it plays an important role in monitoring a small batch or a multitude of servers.

Configuring Zabbix server –

./configure –enable-server –prefix=/usr/local/zabbix –with-mysql –with-net-snmp –with-libcurlmake installmake clean

Compile the Zabbix agent –

./configure –enable-agent –prefix=/usr/local/zabbix –enable-staticmake install

Add Zabbix server and agent ports to /etc/services file – >

echo "zabbix_agent 10050/tcp" >> /etc/servicesecho "zabbix_trap 10051/tcp" >> /etc/services

Copy sample .conf files to /etc/zabbix/ for server and agentd –

cd /etc/mkdir zabbixcp misc/conf/zabbix_agentd.conf /etc/zabbixcp misc/conf/zabbix_server.conf /etc/zabbix

Modify the .conf files as per requirements. In /etc/zabbix/zabbix_server.conf file, change the following –

DBUser=zabbixmysqluserBPassword=zabbixmysqlpasswordDBSocket=/var/lib/mysql/mysql.sockFpingLocation=/usr/sbin/fping

Changes in /etc/zabbix/zabbix_agentd.conf file –

Server=127.0.0.1,your.zabbix.server.IPHostname=EnterTheHostNamecp misc/init.d/redhat/zabbix_agentd_ctl /etc/init.d/zabbix_agentdcp misc/init.d/redhat/zabbix_server_ctl /etc/init.d/zabbix_server

Changes in /etc/init.d/zabbix_agentd and /etc/init.d/zabbix_server files –

BASEDIR=/usr/local/zabbix

In the file /etc/init.d/zabbix_agentd, add the following on the top just after #!/bin/sh

# chkconfig: 345 95 95# description: Zabbix Agentd

In the file /etc/init.d/zabbix_server, add the following on the top just after #!/bin/sh

# chkconfig: 345 95 95# description: Zabbix Server

Configuring auto start and stop of services for different run levels –

chkconfig --level 345 zabbix_server onchkconfig --level 345 zabbix_agentd onchkconfig --level 345 httpd onchkconfig --level 345 mysqld onchkconfig --evel 0123456 iptables off

At the end of this step, please make sure that connections to ports 10050 and 10051 are allowed in the firewall settings. Re-check the firewall rules.

Copy the Zabbix front-end file(s) to the server’s DocumentRoot –

cp -r frontends/php /var/www/html/zabbix

Modify the /etc/php.ini file with the following –

max_execution_time = 300date.timezone = Asia/Calcutta

Note: Remember to specify your time zone in the above setting. You can obtain the time zone name from http://us2.php.net/manual/en/timezones.america.php

Zabbix has an easy mechanism to add the host or service that needs to be monitored, when compared to other software.

Start Apache server for the changes to take effect –

 /etc/init.d/httpd start 

How to execute the LICENSE –

chmod 777 /var/www/html/zabbix/conf

Access http://your-hostname/zabbix and simply follow the instructions.

While you run the steps, you will have to setup the /var/www/html/zabbix/php/conf/zabbix.conf.php file. A sample file would look like how it is shown below –

global $DB_TYPE, $DB_SERVER, $DB_PORT, $DB_DATABASE, $DB_USER, $DB_PASSWORD,$IMAGE_FORMAT_DEFAULT;$DB_TYPE = "MYSQL";$DB_SERVER = "localhost";$DB_PORT = "0";$DB_DATABASE = "zabbix";$DB_USER = "zabbixmysqluser";$DB_PASSWORD = "zabbixmysqlpass";$IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG;

Once the installation is complete, execute the following steps –

chmod 755 /var/www/html/zabbix/confmv /var/www/html/zabbix/setup.php /var/www/html/zabbix/setup.php.bk/etc/init.d/zabbix_agentd start/etc/init.d/zabbix_server start

2. Zabbix Monitoring System Access

http://your-hostname/zabbix/

Login into the Admin area using “admin” as user name. It does not require password at this point, and you can set the login password after you are inside the portal.

If http://your-hostname/zabbix/ does not show anything, it is possible that the php-pear module isn’t installed. In that case, you should consider installing php-pear using the Yum installer.
yum -y install php-pear

You might also want to verify the error logs to spot the exact point of error.

Refer Zabbix tutorial to get more information –
http://www.zabbix.com/manual/

Note: Remember to change zabbixmysqlpass and zabbixmysqluser with preferred values.

3. Conclusion

Zabbix is a software which you can learn quickly and when all is done, it is a complete tool. It combines several functions that are left out of other monitoring software and has a good data collection system. Zabbix has an easy mechanism to add the host or service that needs to be monitored, when compared to other software. It also allows you to build your own maps of different network segments while monitoring many hosts. It has also been reported that Zabbix Windows agent is very easy to install.

Reference:

http://www.zabbix.com/


About the Author :

Joseph Symon has been with Bobcares for more than two years. He has marked his presence in the company through his contributions towards enriching the knowledge level in the company. He is a Linux expert, and specializes in installing and configuring systems and customizing them for specific needs. Joseph is highly passionate about learning new technologies.


6 Comments

  1. karem

    i will try it but i want ask nagios have tool to add it in fire fox what about zabbix?

  2. Primiparo

    this is for Joseph Symon :
    About this step : /etc/init.d/ntpd start

    First all, very good guide. !!.
    I´m installing zabbix server V.1.6 to monitor servers in my internal network. This step is obligatory…?
    At this time, the ntpd is stop in the server where I am installing, and it´s possibly that clocks of the servers that I monitor differ in a few minutes.

    What are you recommends me….?

  3. Joseph Symon

    Hello Primiparo,

    It is important that the time between your devices to be in sync. So it is better to start the ntpd in the zabbix installed server.

  4. Liju

    Hello,

    Nice article…. But I prefers nagios for server monitoring which has lightweight architecture and Cacti will also provide good rrd graph about system resources.

  5. Floost

    I read a few topics. I respect your work and added blog to favorites.

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF