Monitor Cisco switch with Nagios V.2.12
Posted: Mon Jan 10, 2011 5:33 am
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
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