SlideShare a Scribd company logo
Express-Guide
                                       ~to~
                                 Basic Setup of


                             Zabbix
                  an IT Infrastructure Monitoring Solution
                                                by, ABK ~ http://www.twitter.com/aBionic


                                 ::Task Detail::

    Setting up Zabbix Monitoring for IT Services & Infrastructure



                                 ::Background::

Links: http://www.zabbix.com/

Zabbix Server is an enterprise-class open source distributed monitoring solution
designed to monitor and track performance and availability of network servers,
devices and other IT resources.



                              ::Execution Method::

Zabbix Machine installation has mainly two parts.
   First part is setting up of Zabbix Server and Client on that Box with all pre-
     requisites.
   Second one is checking all services detected and providing configurations
     desired over a Web UI available after First part.
The same Web Portal is later used to configure resources over Zabbix to be
monitored.
   ZABBIX Installation Part.1 Walkthrough
     ◦ Pre-Requisite:
        ▪ Installing/Updating, at shell
           #yum -y install ntp php php-bcmath php-mbstring
           #yum -y install php-get php-mysql php-gd gd-devel
           #yum -y install httpd mysql gcc mysql-server mysql-devel
           #yum -y install curl-devel make gmake
           #yum -y install net-snmp net-snmp-utils
           #yum -y install net-snmp-devel net-snmp-libs
◦ Steps
  ▪ Start the NTP Daemon
     • at shell:
        #/etc/init.d/ntpd start

  ▪ Install fping {try using yum, if don't work go for commands below}
    • at shell:
       #wget http://dag.wieers.com/rpm/packages/fping/fping-
       2.4-1.b2.0.rh9.rf.i386.rpm
       #rpm -uvh fping-2.4-1.b2.0.rh9.rf.i386.rpm

  ▪ Make it avaialable at /usr/sbin/fping, if not already present by linking
    and then
    • at shell:
       #chmod 7555 /usr/sbin/fping

  ▪ Adding user for Zabbix
    • at shell:
      #useradd zabbix

  ▪ Download Zabbix's latest stable release and untar it, available at
    http://sourceforge.net/projects/zabbix/files/
    • at shell:
       #curl -L -o zabbix-xxxxx.tar.gz <URL_FOR_zabbix...>
       {like http://downloads.sourceforge.net/project/zabbix/ZABBIX
       %20Latest%20Stable/1.8.2/zabbix-1.8.2.tar.gz?
       use_mirror=space}
       #tar -zxf zabbix-xxxxx.tar.gz

  ▪ Starting MySQL service, and setting it up for use
    • at shell:
       #mysql -u root
       mysql> SET PASSWORD FOR 'root'@'localhost' =
       PASSWORD('new_password');

        mysql> CREATE DATABASE zabbix;

        mysql> GRANT DROP, INDEX,CREATE, SELECT, INSERT, UPDATE,
        ALTER, DELETE ON zabbix.* TO zabbixsqluser@localhost
        IDENTIFIED BY "zabbixsqlpassword";

        mysql> quit;

  ▪ Change current directory to Zabbix's untar
    • at shell:
      #cd zabbix-xxxxx/
▪ Prepare MySQL Database to be used with Zabbix
  • at shell:
     #cat create/schema/mysql.sql | mysql -u zabbixsqluser -p
     zabbix
     #cat create/data/data.sql | mysql -u zabbixsqluser -p
     zabbix
     #cat create/data/images_mysql.sql | mysql -u
     zabbixsqluser -p zabbix

▪ Configuring-n-Installing ZABBiX Server
  • at shell
    #./configure --enable-server --prefix=/usr/local/zabbix
    --with-mysql –with-net-snmp –with-libcurl
    #make install
    #make clean

▪ Configuring-n-Installing ZABBiX Agent
  • at shell:
    #./configure --enable-agent --prefix=/usr/local/zabbix –
    enable-static
    #make install

▪ Installing it as a System Service
  • at shell:
     #echo "zabbix_agent 10050/tcp" >> /etc/servcies
     #echo "zabbix_server 10051/tcp" >> /etc/servcies
     #mkdir /etc/zabbix
     #cp misc/conf/zabbix_agent.conf /etc/zabbix/
     #cp misc/conf/zabbix_server.conf /etc/zabbix/

▪ Edit 'zabbix_server.conf' to suit the system specifications
  • at shell:
     #vi /etc/zabbix/zabbix_server.conf
     set lines for Variables 'DBUser','DBPassword','DBSocket' and
     'FpingLocation' as follows
     ----------------------------------
     DBUser=zabbixsqluser
     DBPassword=zabbixsqlpassword
     DBSocket=/var/lib/mysql/mysql.sock
     FpingLocation=/usr/sbin/fping
     ----------------------------------

▪ Edit 'zabbix_agent.conf' to suit system specification
  • at shell:
     #vi /etc/zabbix/zabbix_agent.conf
     set lines for Variables 'Server','HostName' as follows, create if not
     exists
     ----------------------------------
Server=127.0.0.1, <YourIP>
      HostName=itz_ZABBiX
      ----------------------------------

▪ Copying System Service scripts to suitable directory Considering
  platform being Fedora/CentOS, its copying Service Scripts from fedora
  directory, choose the directory from 'misc/init.d' as per Distro
  • at shell:
      #cp misc/init.d/fedora/core/zabbix_agentd /etc/init.d/
      #cp misc/init.d/fedora/core/zabbix_server /etc/init.d/

▪ Edit '/etc/init.d/zabbix_server' service script for
  change following lines [from ]-->[to]
  ~~~~~~~~~~~~~~~~~~~~~~~~~~
  from-line [ # chkconfig: - 90 10          ]
  to-line    [ # chkconfig: 345 90 10       ]
  ~~~~~~~~~~~~~~~~~~~~~~~~~~
  from-line [ BASEDIR=/opt/zabbix           ]
  to-line    [ BASEDIR=/usr/local/zabbix ]
  ~~~~~~~~~~~~~~~~~~~~~~~~~~
  from-line [ FULLPATH=$BASEDIR/bin/$BINARY_NAME ]
  to-line    [ FULLPATH=$BASEDIR/sbin/$BINARY_NAME ]
  ~~~~~~~~~~~~~~~~~~~~~~~~~~

▪ Edit '/etc/init.d/zabbix_agentd' service script for change following
  lines [from ]-->[to]
  ~~~~~~~~~~~~~~~~~~~~~~~~~~
  from-line [ # chkconfig: - 90 10         ]
  to-line    [ # chkconfig: 345 90 10       ]
  ~~~~~~~~~~~~~~~~~~~~~~~~~~
  from-line [ BASEDIR=/opt/zabbix          ]
  to-line    [ BASEDIR=/usr/local/zabbix ]
  ~~~~~~~~~~~~~~~~~~~~~~~~~~
  from-line [ BINARY_NAME=zabbix_agentd ]
  to-line    [ BINARY_NAME=zabbix_agent ]
  ~~~~~~~~~~~~~~~~~~~~~~~~~~
  from-line [ FULLPATH=$BASEDIR/bin/$BINARY_NAME ]
  to-line    [ FULLPATH=$BASEDIR/sbin/$BINARY_NAME ]
  ~~~~~~~~~~~~~~~~~~~~~~~~~~

▪ Setting up Service to run on startup
  • at shell:
     #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
           #/etc/init.d/iptables stop


     ▪ Enabling it's access as a Web Portal
       • Copying WebUI to DocumentROOT dir
         #cp -r frontends/php /var/www/html/zabbix
       • Editing php.ini according to desired parameters by zabbix
         #vi /etc/php.ini
       • Make following assignments to below variables, changing lines
         [from ]-->[to]
         ~~~~~~~~~~~~~~~~~~~~~~~~~~
         from-line [ max_execution_time = 30 ]
         to-line     [ max_execution_time = 600 ]
         ~~~~~~~~~~~~~~~~~~~~~~~~~~
         from-line [ max_input_time = 60 ]
         to-line     [ max_input_time = 600 ]
         ~~~~~~~~~~~~~~~~~~~~~~~~~~
         from-line [ memory_limit = 128M ]
         to-line     [ memory_limit = 256M ]
         ~~~~~~~~~~~~~~~~~~~~~~~~~~
         from-line [ ; date.timezone = ]
         to-line     [ date.timezone = <Time_Zone like Asia/Calcutta> ]
         ~~~~~~~~~~~~~~~~~~~~~~~~~~
         from-line [ post_max_size = 8M ]
         to-line     [ post_max_size = 64M ]
         ~~~~~~~~~~~~~~~~~~~~~~~~~~
         from-line [ ;mbstring.func_overload = 0 ]
         to-line     [ mbstring.func_overload = 7 ]
         ~~~~~~~~~~~~~~~~~~~~~~~~~~
         from-line [ upload_max_filesize = 2M ]
         to-line     [ upload_max_filesize = 10M ]
         ~~~~~~~~~~~~~~~~~~~~~~~~~~

       •   Restart httpd to bring it in effect
           #/etc/init.d/httpd restart
       •   Enabling Zabbix Conf to get installed
           #chmod 777 /var/www/html/zabbix/conf


 ZABBIX Installation Part.2 Walkthrough

  Now on any machine, open a WebBrowser and go-to link
  "http://<ZabbixServerIP>/zabbix/".

  There you'll be presented an easy installer, read every message
carefully as you proceed.
◦ On First Page
   ▪ you just need to click NEXT
      NOTE: if 'NEXT' aint doing anything, check you edited 'post_max_size'
      in '/etc/php.ini'

◦ On Second Page
  ▪ read [:)] the license agreement and proceed if you agree...
  ▪ check in box for 'I agree' and click 'NEXT>>'

◦ On Third Page if you did all above configuration changes and installation
  nothing should Fail
  ▪ still if any Pre-Requisite fails, just check what you and fix it before
     proceeding
  ▪ and if it shows error for something already installed and configure
     right
  ▪ better 'yum erase <s/w> | yum install <s/w>' than re-install; by
     'httpd' restart

◦ On Fourth Page
  ▪ fill in the boxes with their respective values that you have set
  ▪ like according to settings in this WalkThrough
    • Type:MySQL
    • Host:localhost
    • Port:0
    • Name:zabbix <the database's name>
    • User:zabbixsqluser
    • Password:zabbixsqlpassword
  ▪ click 'NEXT>>'

◦ On Fifth Page
  ▪ change the values here only if you have set your own Port or Host for
    Zabbix Server not following this Walkthrough
  ▪ click 'NEXT>>'

◦ On Sixth Page
  ▪ it just shows all settings you just made... give a check if all is OK
  ▪ click 'NEXT>>'

◦ On Seventh Page
  ▪ if it shows 'Configuration File: Ok' then click 'NEXT>>' else
    Troubleshoot first

◦ On Eighth Page
  ▪ click 'Finish' button, your front-end installation is complete
  ▪ it brings you to login page, the default credentials are
•   User:admin; Password:zabbix


Now the entire installation part is over and we need to carry on with
   ZABBIX Configuration WalkThrough
     ◦ Security/Stability Concerns - change default password first
        ▪ first of all goto 'Administration'-> 'Users' tab
        ▪ in right top corner, below serach-box there will be a combo-box,
           select 'users' in it
        ▪ the listing below will change to existing users on Zabbix
        ▪ click on 'Admin' user listed there, on page opened click 'Change
           Password' and save the change made
     ◦ Configuring the HostGroups
        ▪ goto 'Configuration'-> 'Hostgroups' tab
        ▪ in right top corner, below serach-box thers will be a button 'Create
           Group', click it
        ▪ give in a proper name 'n save
        ▪ this way create as many HostGroups you want to create, better to
           modularize your monitoring right
     ◦ Configuring the Hosts
        ▪ goto 'Configuration'-> 'Hosts' tab
        ▪ in right top corner, below search-box there will be a button 'Create
           Host', click it
        ▪ give in a proper name
        ▪ in 'Groups', select its HostGroup from 'Other Groups' and click '<<'
           button to add it to it
        ▪ or could give in a new HostGroup Name in 'New Group', if forget to
           add earlier
        ▪ fill in DNS-Name and IP-Address
        ▪ select 'Connect To' pattern, the feild selected here must be filled in
           previous step
        ▪ check if Zabbix_Agent port is same as we set during installation, here
           we set it '10050'
        ▪ let status be 'Monitored', thats what you want right

     ◦ Now adding more has binary ways
       ▪ either create as many Hosts you want to create iterating it the above
         way
         OR
       ▪ after doing all setting for a host, select from ‘Configuration>Hosts'
         listing and select 'Full Clone' button, now just make the minimal
         changes like Name, IP, DNS-Name,etc and SAVE it to a new machine

        ▪ Here, in above step while adding a host, one can LINK it to any
          template in right pane of windows, suppose you added it to SNMPv2
          Template, all Applications,Items,Triggers will automatically get added
to it... you will just have to create graph for required ones.
      ◦ Adding Applications to Hosts, and Items to Applications, Triggers and
        Graphs the similar UI as above is available, just fill in right choices.
      ◦ While adding Items if you choose SNMP as mode of interaction, then you
        need to enable SNMP on respective machines with the Community String
        specified here.
      ◦ If you configure for Zabbix Agent, need to install Zabbix Agent on that
        machine.



                          ::Tools/Technology Used::

    Zabbix Server: http://www.zabbix.com/
    Net-SNMP    : http://net-snmp.org
    SNMPWalk     : http://www.net-snmp.org/docs/man/snmpwalk.html



                                  ::Inference::

Zabbix is a nice Monitoring Solution with advanced GUI support managing most of
the tasks. But for large setups this kind of GUI looks slow, at such setups text-
based configuration files based are much faster to work, as in Nagios.

Expanding its capabilities isn't much easy, so for most of the things you need to
work with what you got. Good for users not for tweaks.



                         ::Troubleshooting/Updates::

    Problem: everything was installed as per instructions, but service was
     giving error.
     Solution:
     following things were to be resolved
     ◦ probably the zabbix_server & zabbix_agentd file in /etc/init.d were from
         wrong Distro
     ◦ also in those files, the $BASEDIR was set to wrong location

More Related Content

What's hot (20)

PPTX
StackiFest16: Building a Cluster with Stacki - Greg Bruno
StackIQ
 
PDF
Ansible : what's ansible & use case by REX
Saewoong Lee
 
PPT
Local Dev on Virtual Machines - Vagrant, VirtualBox and Ansible
Jeff Geerling
 
PPT
Tips for a Faster Website
Rayed Alrashed
 
PDF
Salt conf 2014-installing-openstack-using-saltstack-v02
Yazz Atlas
 
PDF
Capistrano
Bryan McLellan
 
PPTX
NLIT 2011: Chef & Capistrano
nickblah
 
PDF
體驗 Hhvm
Chen Cheng-Wei
 
PPT
Python Deployment with Fabric
andymccurdy
 
PPTX
PyCon Russia 2014 - Auto Scale in the Cloud
Simone Soldateschi
 
PDF
Chef Provisioning a Chef Server Cluster - ChefConf 2015
Chef
 
PDF
App development with quasar (pdf)
wonyong hwang
 
PDF
IT Automation with Ansible
Rayed Alrashed
 
PPTX
StackiFest16: How PayPal got a 300 Nodes up in 14 minutes - Greg Bruno
StackIQ
 
PDF
Spot Trading - A case study in continuous delivery for mission critical finan...
SaltStack
 
PDF
Virtual Infrastructure
Bryan McLellan
 
PDF
DATABASE AUTOMATION with Thousands of database, monitoring and backup
Saewoong Lee
 
PPTX
Ansible intro
Hsi-Kai Wang
 
PPTX
Ansible presentation
Kumar Y
 
PDF
MeaNstack on Docker
Daniel Ku
 
StackiFest16: Building a Cluster with Stacki - Greg Bruno
StackIQ
 
Ansible : what's ansible & use case by REX
Saewoong Lee
 
Local Dev on Virtual Machines - Vagrant, VirtualBox and Ansible
Jeff Geerling
 
Tips for a Faster Website
Rayed Alrashed
 
Salt conf 2014-installing-openstack-using-saltstack-v02
Yazz Atlas
 
Capistrano
Bryan McLellan
 
NLIT 2011: Chef & Capistrano
nickblah
 
體驗 Hhvm
Chen Cheng-Wei
 
Python Deployment with Fabric
andymccurdy
 
PyCon Russia 2014 - Auto Scale in the Cloud
Simone Soldateschi
 
Chef Provisioning a Chef Server Cluster - ChefConf 2015
Chef
 
App development with quasar (pdf)
wonyong hwang
 
IT Automation with Ansible
Rayed Alrashed
 
StackiFest16: How PayPal got a 300 Nodes up in 14 minutes - Greg Bruno
StackIQ
 
Spot Trading - A case study in continuous delivery for mission critical finan...
SaltStack
 
Virtual Infrastructure
Bryan McLellan
 
DATABASE AUTOMATION with Thousands of database, monitoring and backup
Saewoong Lee
 
Ansible intro
Hsi-Kai Wang
 
Ansible presentation
Kumar Y
 
MeaNstack on Docker
Daniel Ku
 

Viewers also liked (7)

PPTX
Zabbix - Alem da Infraestrutura - Parte 2
Luiz Sales
 
PDF
Zabbix Smart problem detection - FISL 2015 workshop
Zabbix
 
PDF
Zabbix para iniciantes
Werneck Costa
 
PDF
Alexei Vladishev - Zabbix - Monitoring Solution for Everyone
Zabbix
 
PDF
Andrew Nelson - Zabbix and SNMP on Linux
Zabbix
 
PDF
Zabbix 3.0 and beyond - FISL 2015
Zabbix
 
PPTX
Introduction to Zabbix - Company, Product, Services and Use Cases
Zabbix
 
Zabbix - Alem da Infraestrutura - Parte 2
Luiz Sales
 
Zabbix Smart problem detection - FISL 2015 workshop
Zabbix
 
Zabbix para iniciantes
Werneck Costa
 
Alexei Vladishev - Zabbix - Monitoring Solution for Everyone
Zabbix
 
Andrew Nelson - Zabbix and SNMP on Linux
Zabbix
 
Zabbix 3.0 and beyond - FISL 2015
Zabbix
 
Introduction to Zabbix - Company, Product, Services and Use Cases
Zabbix
 
Ad

Similar to An Express Guide ~ Zabbix for IT Monitoring (20)

PDF
01-Zabbix4Beginners-InstallingZabbix.pdf
NM Consulting, LLC
 
PPTX
Zabbix tutorial
Fu-Ming Tsai
 
PDF
MySQL Monitoring with Zabbix
FromDual GmbH
 
PDF
Alexei vladishev - Open Source Monitoring With Zabbix
André Déo
 
PPTX
Zabbix visión general del sistema - 04.12.2013
Emmanuel Arias
 
ODP
Zabbix API at FISL12 by Takanori Suzuki
takanori suzuki
 
PPTX
Automating Zabbix with Puppet (Werner Dijkerman / 26-11-2015)
Nederlandstalige Zabbix Gebruikersgroep
 
ODP
Zabbix 101 - Enterprise Monitoring doesn't have to suck
Jamie Duncan
 
PDF
OSMC 2017 | How is Zabbix doing – an outside look by Rihards Olups
NETWAYS
 
PDF
Lukas Macura - Employing Zabbix to monitor OpenWrt (Beesip) devices with Uciprov
Zabbix
 
PDF
upgrade to zabbix-7 0 como atualiza lts1
diogolsew
 
PDF
Introduction to My SQL
COMMON Europe
 
ODP
Monitoring shootout loadays
tomdc
 
PDF
Running open source PHP applications on you IBM i
Proximity Group
 
PDF
Alexander Naydenko - Nagios to Zabbix Migration | ZabConf2016
Zabbix
 
PPT
6. centos networking
Mohd yasin Karim
 
ODP
MySQL Monitoring Shoot Out
Kris Buytaert
 
PDF
OSMC 2008 | Monitoring Tools Shootout by Tom De Cooman
NETWAYS
 
PPTX
Nagios Conference 2014 - Rob Hassing - How To Maintain Over 20 Monitoring App...
Nagios
 
01-Zabbix4Beginners-InstallingZabbix.pdf
NM Consulting, LLC
 
Zabbix tutorial
Fu-Ming Tsai
 
MySQL Monitoring with Zabbix
FromDual GmbH
 
Alexei vladishev - Open Source Monitoring With Zabbix
André Déo
 
Zabbix visión general del sistema - 04.12.2013
Emmanuel Arias
 
Zabbix API at FISL12 by Takanori Suzuki
takanori suzuki
 
Automating Zabbix with Puppet (Werner Dijkerman / 26-11-2015)
Nederlandstalige Zabbix Gebruikersgroep
 
Zabbix 101 - Enterprise Monitoring doesn't have to suck
Jamie Duncan
 
OSMC 2017 | How is Zabbix doing – an outside look by Rihards Olups
NETWAYS
 
Lukas Macura - Employing Zabbix to monitor OpenWrt (Beesip) devices with Uciprov
Zabbix
 
upgrade to zabbix-7 0 como atualiza lts1
diogolsew
 
Introduction to My SQL
COMMON Europe
 
Monitoring shootout loadays
tomdc
 
Running open source PHP applications on you IBM i
Proximity Group
 
Alexander Naydenko - Nagios to Zabbix Migration | ZabConf2016
Zabbix
 
6. centos networking
Mohd yasin Karim
 
MySQL Monitoring Shoot Out
Kris Buytaert
 
OSMC 2008 | Monitoring Tools Shootout by Tom De Cooman
NETWAYS
 
Nagios Conference 2014 - Rob Hassing - How To Maintain Over 20 Monitoring App...
Nagios
 
Ad

More from Abhishek Kumar (17)

PDF
Insecurity-In-Security version.2 (2011)
Abhishek Kumar
 
PDF
Insecurity-In-Security version.1 (2010)
Abhishek Kumar
 
PDF
DevOps?!@
Abhishek Kumar
 
PDF
xml-motor ~ What,Why,How
Abhishek Kumar
 
PDF
XML-Motor
Abhishek Kumar
 
PDF
DevOps with Sec-ops
Abhishek Kumar
 
PDF
Syslog Centralization Logging with Windows ~ A techXpress Guide
Abhishek Kumar
 
PDF
Squid for Load-Balancing & Cache-Proxy ~ A techXpress Guide
Abhishek Kumar
 
PDF
Ethernet Bonding for Multiple NICs on Linux ~ A techXpress Guide
Abhishek Kumar
 
PDF
Solaris Zones (native & lxbranded) ~ A techXpress Guide
Abhishek Kumar
 
PDF
An Express Guide ~ "dummynet" for tweaking network latencies & bandwidth
Abhishek Kumar
 
PDF
An Express Guide ~ Cacti for IT Infrastructure Monitoring & Graphing
Abhishek Kumar
 
PDF
An Express Guide ~ SNMP for Secure Rremote Resource Monitoring
Abhishek Kumar
 
PDF
Presentation on "XSS Defeating Concept in (secure)SiteHoster" : 'nullcon-2011'
Abhishek Kumar
 
PDF
XSS Defeating Concept - Part 2
Abhishek Kumar
 
PDF
XSS Defeating Trick ~=ABK=~ WhitePaper
Abhishek Kumar
 
RTF
FreeSWITCH on RedHat, Fedora, CentOS
Abhishek Kumar
 
Insecurity-In-Security version.2 (2011)
Abhishek Kumar
 
Insecurity-In-Security version.1 (2010)
Abhishek Kumar
 
DevOps?!@
Abhishek Kumar
 
xml-motor ~ What,Why,How
Abhishek Kumar
 
XML-Motor
Abhishek Kumar
 
DevOps with Sec-ops
Abhishek Kumar
 
Syslog Centralization Logging with Windows ~ A techXpress Guide
Abhishek Kumar
 
Squid for Load-Balancing & Cache-Proxy ~ A techXpress Guide
Abhishek Kumar
 
Ethernet Bonding for Multiple NICs on Linux ~ A techXpress Guide
Abhishek Kumar
 
Solaris Zones (native & lxbranded) ~ A techXpress Guide
Abhishek Kumar
 
An Express Guide ~ "dummynet" for tweaking network latencies & bandwidth
Abhishek Kumar
 
An Express Guide ~ Cacti for IT Infrastructure Monitoring & Graphing
Abhishek Kumar
 
An Express Guide ~ SNMP for Secure Rremote Resource Monitoring
Abhishek Kumar
 
Presentation on "XSS Defeating Concept in (secure)SiteHoster" : 'nullcon-2011'
Abhishek Kumar
 
XSS Defeating Concept - Part 2
Abhishek Kumar
 
XSS Defeating Trick ~=ABK=~ WhitePaper
Abhishek Kumar
 
FreeSWITCH on RedHat, Fedora, CentOS
Abhishek Kumar
 

An Express Guide ~ Zabbix for IT Monitoring

  • 1. Express-Guide ~to~ Basic Setup of Zabbix an IT Infrastructure Monitoring Solution by, ABK ~ http://www.twitter.com/aBionic ::Task Detail::  Setting up Zabbix Monitoring for IT Services & Infrastructure ::Background:: Links: http://www.zabbix.com/ Zabbix Server is an enterprise-class open source distributed monitoring solution designed to monitor and track performance and availability of network servers, devices and other IT resources. ::Execution Method:: Zabbix Machine installation has mainly two parts.  First part is setting up of Zabbix Server and Client on that Box with all pre- requisites.  Second one is checking all services detected and providing configurations desired over a Web UI available after First part. The same Web Portal is later used to configure resources over Zabbix to be monitored.  ZABBIX Installation Part.1 Walkthrough ◦ Pre-Requisite: ▪ Installing/Updating, at shell #yum -y install ntp php php-bcmath php-mbstring #yum -y install php-get php-mysql php-gd gd-devel #yum -y install httpd mysql gcc mysql-server mysql-devel #yum -y install curl-devel make gmake #yum -y install net-snmp net-snmp-utils #yum -y install net-snmp-devel net-snmp-libs
  • 2. ◦ Steps ▪ Start the NTP Daemon • at shell: #/etc/init.d/ntpd start ▪ Install fping {try using yum, if don't work go for commands below} • at shell: #wget http://dag.wieers.com/rpm/packages/fping/fping- 2.4-1.b2.0.rh9.rf.i386.rpm #rpm -uvh fping-2.4-1.b2.0.rh9.rf.i386.rpm ▪ Make it avaialable at /usr/sbin/fping, if not already present by linking and then • at shell: #chmod 7555 /usr/sbin/fping ▪ Adding user for Zabbix • at shell: #useradd zabbix ▪ Download Zabbix's latest stable release and untar it, available at http://sourceforge.net/projects/zabbix/files/ • at shell: #curl -L -o zabbix-xxxxx.tar.gz <URL_FOR_zabbix...> {like http://downloads.sourceforge.net/project/zabbix/ZABBIX %20Latest%20Stable/1.8.2/zabbix-1.8.2.tar.gz? use_mirror=space} #tar -zxf zabbix-xxxxx.tar.gz ▪ Starting MySQL service, and setting it up for use • at shell: #mysql -u root mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('new_password'); mysql> CREATE DATABASE zabbix; mysql> GRANT DROP, INDEX,CREATE, SELECT, INSERT, UPDATE, ALTER, DELETE ON zabbix.* TO zabbixsqluser@localhost IDENTIFIED BY "zabbixsqlpassword"; mysql> quit; ▪ Change current directory to Zabbix's untar • at shell: #cd zabbix-xxxxx/
  • 3. ▪ Prepare MySQL Database to be used with Zabbix • at shell: #cat create/schema/mysql.sql | mysql -u zabbixsqluser -p zabbix #cat create/data/data.sql | mysql -u zabbixsqluser -p zabbix #cat create/data/images_mysql.sql | mysql -u zabbixsqluser -p zabbix ▪ Configuring-n-Installing ZABBiX Server • at shell #./configure --enable-server --prefix=/usr/local/zabbix --with-mysql –with-net-snmp –with-libcurl #make install #make clean ▪ Configuring-n-Installing ZABBiX Agent • at shell: #./configure --enable-agent --prefix=/usr/local/zabbix – enable-static #make install ▪ Installing it as a System Service • at shell: #echo "zabbix_agent 10050/tcp" >> /etc/servcies #echo "zabbix_server 10051/tcp" >> /etc/servcies #mkdir /etc/zabbix #cp misc/conf/zabbix_agent.conf /etc/zabbix/ #cp misc/conf/zabbix_server.conf /etc/zabbix/ ▪ Edit 'zabbix_server.conf' to suit the system specifications • at shell: #vi /etc/zabbix/zabbix_server.conf set lines for Variables 'DBUser','DBPassword','DBSocket' and 'FpingLocation' as follows ---------------------------------- DBUser=zabbixsqluser DBPassword=zabbixsqlpassword DBSocket=/var/lib/mysql/mysql.sock FpingLocation=/usr/sbin/fping ---------------------------------- ▪ Edit 'zabbix_agent.conf' to suit system specification • at shell: #vi /etc/zabbix/zabbix_agent.conf set lines for Variables 'Server','HostName' as follows, create if not exists ----------------------------------
  • 4. Server=127.0.0.1, <YourIP> HostName=itz_ZABBiX ---------------------------------- ▪ Copying System Service scripts to suitable directory Considering platform being Fedora/CentOS, its copying Service Scripts from fedora directory, choose the directory from 'misc/init.d' as per Distro • at shell: #cp misc/init.d/fedora/core/zabbix_agentd /etc/init.d/ #cp misc/init.d/fedora/core/zabbix_server /etc/init.d/ ▪ Edit '/etc/init.d/zabbix_server' service script for change following lines [from ]-->[to] ~~~~~~~~~~~~~~~~~~~~~~~~~~ from-line [ # chkconfig: - 90 10 ] to-line [ # chkconfig: 345 90 10 ] ~~~~~~~~~~~~~~~~~~~~~~~~~~ from-line [ BASEDIR=/opt/zabbix ] to-line [ BASEDIR=/usr/local/zabbix ] ~~~~~~~~~~~~~~~~~~~~~~~~~~ from-line [ FULLPATH=$BASEDIR/bin/$BINARY_NAME ] to-line [ FULLPATH=$BASEDIR/sbin/$BINARY_NAME ] ~~~~~~~~~~~~~~~~~~~~~~~~~~ ▪ Edit '/etc/init.d/zabbix_agentd' service script for change following lines [from ]-->[to] ~~~~~~~~~~~~~~~~~~~~~~~~~~ from-line [ # chkconfig: - 90 10 ] to-line [ # chkconfig: 345 90 10 ] ~~~~~~~~~~~~~~~~~~~~~~~~~~ from-line [ BASEDIR=/opt/zabbix ] to-line [ BASEDIR=/usr/local/zabbix ] ~~~~~~~~~~~~~~~~~~~~~~~~~~ from-line [ BINARY_NAME=zabbix_agentd ] to-line [ BINARY_NAME=zabbix_agent ] ~~~~~~~~~~~~~~~~~~~~~~~~~~ from-line [ FULLPATH=$BASEDIR/bin/$BINARY_NAME ] to-line [ FULLPATH=$BASEDIR/sbin/$BINARY_NAME ] ~~~~~~~~~~~~~~~~~~~~~~~~~~ ▪ Setting up Service to run on startup • at shell: #chkconfig --level 345 zabbix_server on #chkconfig --level 345 zabbix_agentd on #chkconfig --level 345 httpd on #chkconfig --level 345 mysqld on
  • 5. #chkconfig --level 0123456 iptables off #/etc/init.d/iptables stop ▪ Enabling it's access as a Web Portal • Copying WebUI to DocumentROOT dir #cp -r frontends/php /var/www/html/zabbix • Editing php.ini according to desired parameters by zabbix #vi /etc/php.ini • Make following assignments to below variables, changing lines [from ]-->[to] ~~~~~~~~~~~~~~~~~~~~~~~~~~ from-line [ max_execution_time = 30 ] to-line [ max_execution_time = 600 ] ~~~~~~~~~~~~~~~~~~~~~~~~~~ from-line [ max_input_time = 60 ] to-line [ max_input_time = 600 ] ~~~~~~~~~~~~~~~~~~~~~~~~~~ from-line [ memory_limit = 128M ] to-line [ memory_limit = 256M ] ~~~~~~~~~~~~~~~~~~~~~~~~~~ from-line [ ; date.timezone = ] to-line [ date.timezone = <Time_Zone like Asia/Calcutta> ] ~~~~~~~~~~~~~~~~~~~~~~~~~~ from-line [ post_max_size = 8M ] to-line [ post_max_size = 64M ] ~~~~~~~~~~~~~~~~~~~~~~~~~~ from-line [ ;mbstring.func_overload = 0 ] to-line [ mbstring.func_overload = 7 ] ~~~~~~~~~~~~~~~~~~~~~~~~~~ from-line [ upload_max_filesize = 2M ] to-line [ upload_max_filesize = 10M ] ~~~~~~~~~~~~~~~~~~~~~~~~~~ • Restart httpd to bring it in effect #/etc/init.d/httpd restart • Enabling Zabbix Conf to get installed #chmod 777 /var/www/html/zabbix/conf  ZABBIX Installation Part.2 Walkthrough Now on any machine, open a WebBrowser and go-to link "http://<ZabbixServerIP>/zabbix/". There you'll be presented an easy installer, read every message
  • 6. carefully as you proceed. ◦ On First Page ▪ you just need to click NEXT NOTE: if 'NEXT' aint doing anything, check you edited 'post_max_size' in '/etc/php.ini' ◦ On Second Page ▪ read [:)] the license agreement and proceed if you agree... ▪ check in box for 'I agree' and click 'NEXT>>' ◦ On Third Page if you did all above configuration changes and installation nothing should Fail ▪ still if any Pre-Requisite fails, just check what you and fix it before proceeding ▪ and if it shows error for something already installed and configure right ▪ better 'yum erase <s/w> | yum install <s/w>' than re-install; by 'httpd' restart ◦ On Fourth Page ▪ fill in the boxes with their respective values that you have set ▪ like according to settings in this WalkThrough • Type:MySQL • Host:localhost • Port:0 • Name:zabbix <the database's name> • User:zabbixsqluser • Password:zabbixsqlpassword ▪ click 'NEXT>>' ◦ On Fifth Page ▪ change the values here only if you have set your own Port or Host for Zabbix Server not following this Walkthrough ▪ click 'NEXT>>' ◦ On Sixth Page ▪ it just shows all settings you just made... give a check if all is OK ▪ click 'NEXT>>' ◦ On Seventh Page ▪ if it shows 'Configuration File: Ok' then click 'NEXT>>' else Troubleshoot first ◦ On Eighth Page ▪ click 'Finish' button, your front-end installation is complete ▪ it brings you to login page, the default credentials are
  • 7. User:admin; Password:zabbix Now the entire installation part is over and we need to carry on with  ZABBIX Configuration WalkThrough ◦ Security/Stability Concerns - change default password first ▪ first of all goto 'Administration'-> 'Users' tab ▪ in right top corner, below serach-box there will be a combo-box, select 'users' in it ▪ the listing below will change to existing users on Zabbix ▪ click on 'Admin' user listed there, on page opened click 'Change Password' and save the change made ◦ Configuring the HostGroups ▪ goto 'Configuration'-> 'Hostgroups' tab ▪ in right top corner, below serach-box thers will be a button 'Create Group', click it ▪ give in a proper name 'n save ▪ this way create as many HostGroups you want to create, better to modularize your monitoring right ◦ Configuring the Hosts ▪ goto 'Configuration'-> 'Hosts' tab ▪ in right top corner, below search-box there will be a button 'Create Host', click it ▪ give in a proper name ▪ in 'Groups', select its HostGroup from 'Other Groups' and click '<<' button to add it to it ▪ or could give in a new HostGroup Name in 'New Group', if forget to add earlier ▪ fill in DNS-Name and IP-Address ▪ select 'Connect To' pattern, the feild selected here must be filled in previous step ▪ check if Zabbix_Agent port is same as we set during installation, here we set it '10050' ▪ let status be 'Monitored', thats what you want right ◦ Now adding more has binary ways ▪ either create as many Hosts you want to create iterating it the above way OR ▪ after doing all setting for a host, select from ‘Configuration>Hosts' listing and select 'Full Clone' button, now just make the minimal changes like Name, IP, DNS-Name,etc and SAVE it to a new machine ▪ Here, in above step while adding a host, one can LINK it to any template in right pane of windows, suppose you added it to SNMPv2 Template, all Applications,Items,Triggers will automatically get added
  • 8. to it... you will just have to create graph for required ones. ◦ Adding Applications to Hosts, and Items to Applications, Triggers and Graphs the similar UI as above is available, just fill in right choices. ◦ While adding Items if you choose SNMP as mode of interaction, then you need to enable SNMP on respective machines with the Community String specified here. ◦ If you configure for Zabbix Agent, need to install Zabbix Agent on that machine. ::Tools/Technology Used::  Zabbix Server: http://www.zabbix.com/  Net-SNMP : http://net-snmp.org  SNMPWalk : http://www.net-snmp.org/docs/man/snmpwalk.html ::Inference:: Zabbix is a nice Monitoring Solution with advanced GUI support managing most of the tasks. But for large setups this kind of GUI looks slow, at such setups text- based configuration files based are much faster to work, as in Nagios. Expanding its capabilities isn't much easy, so for most of the things you need to work with what you got. Good for users not for tweaks. ::Troubleshooting/Updates::  Problem: everything was installed as per instructions, but service was giving error. Solution: following things were to be resolved ◦ probably the zabbix_server & zabbix_agentd file in /etc/init.d were from wrong Distro ◦ also in those files, the $BASEDIR was set to wrong location