Link to home
Start Free TrialLog in
Avatar of antmax00
antmax00Flag for United States of America

asked on

Nagios

New to Nagios and linux. I installed the nagios core and plugins. I'm trying to figure out how to add some basic host for monitoring. Currently it only shows my local machine. I would like to monitor my cisco equipment and my windows based servers.  How do i go about configuring nagios to do this?
ASKER CERTIFIED SOLUTION
Avatar of wesly_chen
wesly_chen
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of edwarneke
edwarneke

As wesly stated you should probably read the readme files as it's very important to have a solid grasp of what it's checking and how the config files should be checked.

With that being said, there are really 2 places you need to define what you are monitoring. In the etc folder is a nagios.cfg file. You should see annotations to the specific fields. In order to monitor a device it needs to be in this config file, either as the config file named specifically, or as a group(and the config is in the associated group).

In mine I have the group windows_servers being monitored (cfg_dir=/usr/local/nagios/etc/objects/windows_servers
)

Under the objects folder I then have my templates, and folders for my groups. I currently only use the windowstemplates.cfg file as I'm only monitoring windows boxes.

Inside the template you will find definitions for various services you want to monitor. You can add these in manually to the config files of the servers you are monitoring, but using templates makes it easier so you don't have to enter the definition 100 times, you can just refer to the template. Here's an example of my BES(blackberry enterprise server) service checking template. It will tell me if the BES router service goes down:

define service{
        use                     windowsservice_template
        name                    BES_Router_template
        service_description     Blackberry Enterprise Server Router Service
        check_command           check_nt!SERVICESTATE!-d SHOWALL -l "BlackBerry Router"
        register 0
        }

Then from there you can make your individual server/device config files similar to what wesley put in his first post. Start out defining the host, then you can use the templates like so rather than defining the host services:

define service{
        use                     BES_Router_template
        host_name                       servername      #this is defined in the host portion as host_name
        }

Once you figure it out it's pretty straight forward to add in your own services to monitor and you can copy and paste the config files and just tweak names to monitor different devices.
For monitoirng windows server you have to use nsclient++ - http://nsclient.org/nscp/ 
Monitoring network switches using nagios - http://www.thegeekstuff.com/2008/11/how-to-monitor-network-switch-and-ports-using-nagios/
More plugins  to monitor CISCO equipments using nagios - http://exchange.nagios.org/directory/Plugins/Hardware/Network-Gear/Cisco
Yep NSClient is what I use to monitor my windows servers.