Monitor Cisco switch with Nagios V.2.12

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
elad.dotan
Posts: 1
Joined: Mon Jan 10, 2011 5:17 am

Monitor Cisco switch with Nagios V.2.12

Post by elad.dotan »

Hi,
I've just installed the application on my CenOs server.
I used the default configuration and I'm able to monitor the server.

I would like to monitor my cisco 2950 switch.
I added a line in the nagios.cfg:
cfg_file=/etc/nagios/switch.cfg
and created a file called switch.cfg in /etc/nagios (I don't have the folder "objects")

I also used a template for the switch.cfg:

but when I try to start the nagios again...I get "Starting nagios:CONFIG ERROR! Start aborted. Check your Nagios configuration."
can anyone help me?
Thanks!
Elad.

# Define the switch that we'll be monitoring


define host{

use generic-switch ; Inherit default values from a template
host_name linksys-srw224p ; The name we're giving to this switch
alias Linksys SRW224P Switch ; A longer name associated with the switch
address 192.168.2.92 ; IP address of the switch
hostgroups switches ; Host groups this switch is associated with
}


# Create a service to PING to switch
define service{
use generic-service ; Inherit values from a template
host_name linksys-srw224p ; The name of the host the service is associated with
service_description PING ; The service description
check_command check_ping!200.0,20%!600.0,60% ; The command used to monitor the service
normal_check_interval 5 ; Check the service every 5 minutes under normal conditions
retry_check_interval 1 ; Re-check the service every minute until its final/hard state is determined
}

# Monitor uptime via SNMP
define service{
use generic-service ; Inherit values from a template
host_name linksys-srw224p
service_description Uptime
check_command check_snmp!-C public -o sysUpTime.0
}

# Monitor Port 1 status via SNMP
define service{
use generic-service ; Inherit values from a template
host_name linksys-srw224p
service_description Port 1 Link Status
check_command check_snmp!-C public -o ifOperStatus.1 -r 1 -m RFC1213-MIB
erobinson
Posts: 3
Joined: Thu Nov 04, 2010 3:48 pm

Re: Monitor Cisco switch with Nagios V.2.12

Post by erobinson »

You are missing a } at the very end of your document. Something as small as that can keep it from starting up. Pull out that fine toothed comb.

Also, i'm pretty sure you have to have an objects folder. Where is your Nagios.cfg file located.

With my centos install it is in /usr/local/nagios/etc/objects.

I hope it helps,

-eric
Locked