Nagios

antmax00
antmax00 used Ask the Experts™
on
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?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2011
Commented:
Check this URL for some basic stuff of Nagios.

To add a new device into Nagios, you need to
1. define the device/host (host_name, alias, and address)
such as"
define host{
        use             linux-host
        host_name       fs-web.internal.domain
        alias           fs-web.internal.domain
        address         10.95.1.22
}

2. define the service to that host (check_cpu, check_load....)
such as
define service {
        use                     p2-service
        service_description     check_cpu
        hostgroup_name          All-internal
        check_command           check_nrpe!check_cpu
}


For a beginner, I recommend you read through the website to get some understanding for the Nagios. Because, it requires the change on multiple files (at least two) even though you just want to add a new host.
Top Expert 2011

Commented:
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.
Deepak KosarajuDevOps Engineer

Commented:
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.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial