Sharmith's Blog_ How to Install and Configure NAGIOS for Monitoring CISCO Device on FEDORA

Please download to get full document.

View again

of 7
All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.


Document Related
Document Description
nagios install
Document Share
Document Tags
Document Transcript
  Friday, October 5, 2012 How to Install and configure NAGIOS for monitoring CISCO device on FEDORA  Nagios Nagios is an open source free monitoring tool which is widely used by people to monitor their infrastructure devicesand to create reports on the availability of the services. This tool has the capability to alert the status of services ordevices in realtime, based on your configuration on to a web based dashboard, email, sms etc………Ethan Galstad created this wonderful monitoring tool and is currently supported by him and a group of developersactively maintaining the plugins for it which are official and unofficial. It is licensed under GNU version .Nagios has got the ability to monitor services, hosts and anything else which have the ability to send collected data via anetwor! to specifically written plugins. Nagios collects information with the help of N#$ and agents installed on theremote systems.I am trying to e%plain over here the installation of Nagios on a &inu% system running 'edora and the configurationre(uired on it to ma!e the application useful for monitoring your networ! devices li!e )outers, switches, firewalls,loadbalancers and services li!e * #T$, $+$, -TT$, NNT$, I#$, N#$, 'T$, -/ with the usage of differentplugins available at sites given below. Download Sites: Nagios ore0http011www.nagios.org1download1core1than!s1 2ddons0 *clients/http011www.nagios.org1download1addons1$lugins0http011www.nagios.org1download1plugins1 or Nagios E%change hp://exchange . nagios .org 'rontends0 *GUI/http011www.nagios.org1download1frontends1 Prerequisites Run all steps from this document with  root  permissions. The following command can be run to switch to a root shell.>su – root*** This will prompt for root user password. After entering the same the prompt will change to root.# Issue the command 3pwd4 to chec! the present directory 5pwdInstall the dependency pac!ages and applications #yum install -y wget httpd php gcc glibc glibc-common gd gd-devel make net-snmp To start with I will detail the steps for installing the Nagios ore pac!age from the source to a linu% fedora distribution. tep 6 7ou could download the source pac!age from the lin!s given above or by running the command given below. Run the following commands in your terminal:To change the directory to temporary folder#cd /tmp#wget This will download Nagios core pac!age and the re(uired plugins. tep reating User accounts and Group #useradd nagios#groupadd nagcmd#usermod -a -G nagcmd nagios tep E%tracting the downloaded pac!ages #tar zxvf nagios-3.4.1.tar.gz#tar zxvf nagios-plugins-1.4.15.tar.gz tep 8+nce you e%tract the file you will get a folder with the name 3nagios4. hange to the directory and configure. #cd nagios with Google Friend Connect Members (5) Already a member? Sign in Followers sharmith ramesh I am the only one and yoursearch lasts here 0/ 9iew my complete profile About Me   :6 *;/   +ctober */-ow to Install andconfigure N2GI+ for monitoring...<ac!up cript in &inu%    2ugust */   =uly *6/   =une *6/   #ay *6/ Blog Archive   sharmith's blog: How to Install and configure NAGIOS for monitoring... of 71/26/2014 6:32 PM  #./configure --with-command-group=nagcmd#make all#make install#make install-init#make install-config#make install-commandmode#make install-webconf #cp -R contrib/eventhandlers/ /usr/local/nagios/libexec/ #chown -R nagios:nagios /usr/local/nagios/libexec/eventhandlers For verifying the configuration: #/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfgThis should give zero errors and zero warnings before restarting the nagios service.Starting the Nagios service#/etc/init.d/nagios startStarting the Web service#/etc/init.d/httpd start reate a >efault User for ?eb 2ccess. Add a default user for Web Interface Access:#htpasswd –c /usr/local/nagios/etc/htpasswd.users nagiosadmin*** You will be prompted for a password for the account Nagios Plugin Installation After extracting the plugin file with the tar command as explained earlier.#cd /tmp/nagios-plugins-1.4.15#./configure --with-nagios-user=nagios --with-nagios-group=nagios#make#make install Nagios Service Setup The following commands will register the Nagios daemon to be run upon system startup.#chkconfig --add nagios#chkconfig --level 35 nagios on#chkconfig --add httpd#chkconfig --level 35 httpd  Web Access: After completing the steps followed above and verifying the configurations without any errors or warnings, you should be able to access theNagios tool GUI with web by issuing the command in the url of your browser. Edit the section of the IP with the IP of your system.http:///nagios**** Log in with the credentials you chose while adding the “nagiosadmin” user to the “htpasswd.users” file. -ere I will introduce you to the main configuration files which are re(uired for ma!ing the configuration changes forma!ing the tool ready as per our re(uirement.  Important configuration files and locations:   6/   #ain nagios configuration file1usr1local1nagios1etc1nagios.cfg@@@@  2ll the below mentioned files locations and some configuration parameters are mentioned over in this file./   'ile for storing paths for useraccount to plugins and eventhandlers1usr1local1nagios1etc1resource.cfg/   'or setting the configurations for the tool GUI1usr1local1nagios1etc1cgi.cfg88/   'or defining the device or service configuration parameters.Eg0A1usr1local1nagios1etc1obBects1switch.cfg 1usr1local1nagios1etc1obBects1)outer6.cfgCC/   >efining -ost Information file0 *Useful for ma!ing the host or service appear on the map/51usr1local1nagios1etc1obBects hoste%tinfo.cfgDD/   >efining generic service template file0 *Used while creating -ost or ervice for inheriting the configuration/51usr1local1nagios1etc1obBects1templates.cfg;;/   >efining Timeperiods template file0 *Timeperiods used in -ost and services configuration/51usr1local1nagios1etc1obBects1timeperiods.cfg Configuration of agios for !onitoring your critical services and devices sharmith's blog: How to Install and configure NAGIOS for monitoring... of 71/26/2014 6:32 PM  /   >efining commands and its synta% with parameters01usr1local1nagios1etc1obBects1commands.cfgFF/   >efining contacts to be notified and their availability time051usr1local1nagios1etc1obBects1contacts.cfg Detail of device to be monitored : -ostname0 )outer6Ip address0 N#$ tring0 publicInterface0 GigabitEthernet:1: , 'astEthernet :1:1: On the isco !outer: accessAlist  permit ...snmpAserver community public )+ snmpAserver host IpAaddressHsnmpAserver enable traps snmp authentication lin!down lin!up coldstart warmstartsnmpAserver enable traps memory snmpAserver enable traps cputhreshold@@@@  2ccess list number and )+ number should match.#ention any other traps which you want to be notified as per your re(uirement. reate a configuration file for the device under the directory #usr#local#nagios#etc#ob$ects#% Template for Networ! device in router.cfg5vi 1usr1local1nagios1etc1obBects1router.cfg5555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555 -+ T >E'INITI+N 5555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555 >efine the )outer that weJll be monitoringdefine host use genericAswitch K Inherit default values from a template name myrouter alias myrouters K 2 longer name associated with the switch hostgroups routers K -ost groups this switch is associated with register : H5555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555 -+ T G)+U$ >E'INITI+N 5555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555 reate a new hostgroup for routerssdefine hostgroup hostgroupname routers K The name of the hostgroup alias Networ! )outers K &ong name of the group H5555555555555555555555555555555555555555555555555555555555555555555555555555555To save the file Esc L hift 0w( ave and e%it the configuration@@@ $lease note the 3register :4 parameter in the configuration. This defines that the configuration is a dummy file ortemplate. This template will be referenced for use in other host<efore creating this file you need to ma!e sure that you have the plugins mentioned below for wor!ing of thisconfiguration. &ocate these files in 1ur1local1nagios1libe%ec1 !e&uired 'lugins: chec!pingchec!snmpload.plchec!snmpmemv6chec!snmp5vi 1usr1local1nagios1etc1obBects1)outer6.cfg5555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555 -+ T >E'INITI+N 555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555 sharmith's blog: How to Install and configure NAGIOS for monitoring... of 71/26/2014 6:32 PM  55555555555555555555555555555555555555555555555555555555555555555555555555555555define host use genericArouter K Inherit default values from a template mentioned above hostname )outer6 5555555 -ostname as defined on the device alias ?2N A)outer K 2 longer name associated with the switch address 555555 I$ address of the device parents witch 55555 To which device is this connected. ?ith E%act hostname hostgroups  ?2NA>evices 55555 Group to which this device will be listed +##UNIT7 public 5555 N#$ string H555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555 -+ T E%tended Information 555555555555555555555555555555555555define hoste%tinfo hostname )outer65 dcoords 8:,8: iconimage cisco.png 55555 $lace the logo 1usr1local1nagios1share1images1logos1 vrmlimage cisco.png 55555 $lace the logo 1usr1local1nagios1share1images1logos1 statusmapimage cisco.png 5555 2bove location H5555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555 E)9IE >E'INITI+N 55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555 #onitoring )outer Uptime 5555555555555555define service use genericAservice K Inherit values from a template hostname )outer6 servicedescription Uptime chec!command chec!snmpMA public Ao sysUpTime.: H55555555555 #onitoring )outer 2vailability with $ING 5555555555555555define service use genericAservice K Inherit values from a template hostname )outer6 K The name of the host the service is associated with servicedescription $ING K The service description chec!command chec!pingM::.:,:MD::.:,D: K The command used to monitor the service normalchec!interval 6 K hec! the service every 6 minutes under normal conditions retrychec!interval 6 K )eAchec! the service every minute until its final1hard state is determined H55555555555 #onitoring )outer $U &oad tatus 5555555555555555define service use genericAservice hostname )outer6 servicedescription $U&oad chec!command chec!snmpload.plMpublicMciscoM8:,8:,8:MD:,D:,D: normalchec!interval 6 retrychec!interval 6 notificationoptions w,c,r contactgroups 8O; 55555555 #ention the contact group name defined in contacts.cfg H55555555555 #onitoring )outer #emory 5555555555555555define service use genericAservice K Inherit values from a template hostname )outer6 servicedescription #emory  chec!command chec!snmpmemv6MpublicMAIMD:M;: 5555 ?arning to D: and ritical to ;: normalchec!interval 6 retrychec!interval 6 notificationoptions w,c,r contactgroups 8O; 55555555 #ention the contact group name defined in contacts.cfg H55555555555 #onitoring Interface tatus 5555555555555555define service use genericAservice K Inherit values from a template hostname )outer6 servicedescription GigabitEthernet:1: 555 Name of the Interface for identification chec!command chec!snmpMA public Ao if+per tatus.6 Ar 6 Am )'66A#I<Hdefine service use genericAservice K Inherit values from a template hostname )outer6 servicedescription 'astEthernet:1:1: chec!command chec!snmpMA public Ao if+per tatus.8 Ar 6 Am )'66A#I<H5555555555555#onitoring <andwidth 1 Traffic )ate 555555555555555555555555555555 7ou need to have already #)TG running and graphing for this device interfacedefine service sharmith's blog: How to Install and configure NAGIOS for monitoring... of 71/26/2014 6:32 PM
Search Related
We Need Your Support
Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

Thanks to everyone for your continued support.

No, Thanks

We need your sign to support Project to invent "SMART AND CONTROLLABLE REFLECTIVE BALLOONS" to cover the Sun and Save Our Earth.

More details...

Sign Now!

We are very appreciated for your Prompt Action!