<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'><div dir='ltr'>
Hi all,<BR><BR>I have a Cisco 2960 which is configured for SNMP. The machine's IP is 10.10.10.3 and can communicate with the Cisco 2960 switch 10.10.10.2 via SNMP.<BR>(I tested it with snmpwalk -v 3 -u tom -l authPriv -a sha -A [passwordpassword] -x aes -X passwordpassword 10.10.10.2)<BR><BR>And I also modified Nagios's switch.cfg (code below). Nagios is now monitoring the switch. <BR><BR>I tried running this command ./check_snmp -H 10.10.10.2 -o "ifOperStatus.1" -U tom -A [passwordpassword] -X passwordpassword -L authPriv -P 3 -a MD5 -c 1050<BR><BR>But looks like it's not working: <BR><BR>SNMP problem - No data received from host<BR>CMD: /usr/bin/snmpget -t 1 -r 5 -m ALL -v 3 [authpriv] 10.10.10.2:161  ifOperStatus.1<BR><BR>What I would like to do is configure Nagios to poll this switch via SNMP v3. So I understand the check_command part should be changed but am not sure how to do that. <BR><BR><BR>Can you please help?<BR><BR>Thanks in advance,<BR>t<BR><BR><BR><BR><BR>###############################################################################<BR>###############################################################################<BR>#<BR># HOST DEFINITIONS<BR>#<BR>###############################################################################<BR>###############################################################################<BR><BR># Define the switch that we'll be monitoring<BR><BR>define host{<BR>        use             generic-switch          ; Inherit default values from a template<BR>        host_name       linksys-srw224p         ; The name we're giving to this switch<BR>        alias           Linksys SRW224P Switch  ; A longer name associated with the switch<BR>        address         192.168.1.253           ; IP address of the switch<BR>        hostgroups      switches                ; Host groups this switch is associated with<BR>        }<BR><BR>define host{<BR>use             generic-switch<BR>host_name       core-switch<BR>alias           Cisco Core Switch<BR>address         10.10.10.2<BR>hostgroups      switches<BR>}<BR><BR><BR>###############################################################################<BR>###############################################################################<BR>#<BR># HOST GROUP DEFINITIONS<BR>#<BR>###############################################################################<BR>###############################################################################<BR><BR># Create a new hostgroup for switches<BR>define hostgroup{<BR>        hostgroup_name  switches                ; The name of the hostgroup<BR>        alias           Network Switches        ; Long name of the group<BR>        }<BR><BR><BR><BR><BR>###############################################################################<BR>###############################################################################<BR>#<BR># SERVICE DEFINITIONS<BR>#<BR>###############################################################################<BR>###############################################################################<BR><BR># Create a service to PING to switch<BR><BR>define service{<BR>        use                     generic-service ; Inherit values from a template<BR>        host_name               linksys-srw224p ; The name of the host the service is associated with<BR>        service_description     PING            ; The service description<BR>        check_command           check_ping!200.0,20%!600.0,60%  ; The command used to monitor the service<BR>        normal_check_interval   5               ; Check the service every 5 minutes under normal conditions<BR>        retry_check_interval    1               ; Re-check the service every minute until its final/hard state is determined<BR>        }<BR><BR><BR># Monitor uptime via SNMP<BR><BR>define service{<BR>        use                     generic-service ; Inherit values from a template<BR>        host_name               linksys-srw224p<BR>        service_description     Uptime<BR>        check_command           check_snmp!-C public -o sysUpTime.0<BR>        }<BR><BR><BR><BR># Monitor Port 1 status via SNMP<BR><BR>define service{<BR>        use                     generic-service ; Inherit values from a template<BR>        host_name               linksys-srw224p<BR>        service_description     Port 1 Link Status<BR>        check_command           check_snmp!-C public -o ifOperStatus.1 -r 1 -m RFC1213-MIB<BR>        }<BR><BR># Monitor bandwidth via MRTG logs<BR><BR>define service{<BR>        use                     generic-service ; Inherit values from a template<BR>        host_name               linksys-srw224p<BR>        service_description     Port 1 Bandwidth Usage<BR>        check_command           check_local_mrtgtraf!/var/lib/mrtg/192.168.1.253_1.log!AVG!1000000,1000000!5000000,5000000!10<BR>        }<BR><BR><BR># Service definition to ping the switch using check_ping<BR>define service{<BR>use                     generic-service<BR>hostgroup_name          switches<BR>service_description     PING<BR>check_command           check_ping!200.0,20%!600.0,60%<BR>normal_check_interval   5<BR>retry_check_interval    1<BR>}<BR><BR># Service definition to monitor switch uptime using check_snmp<BR>define service{<BR>use                     generic-service<BR>hostgroup_name          switches<BR>service_description     Uptime<BR>check_command           check_snmp!-C public -o sysUpTime.0<BR>}<BR><BR><BR># Monitor status of port number 1 on the Cisco core switch<BR>define service{<BR>use                  generic-service<BR>host_name            core-switch<BR>service_description  Port 1 Link Status<BR>check_command        check_snmp!-C public -o ifOperStatus.1 -r 1 -m RFC1213-MIB<BR>}<BR><BR># Monitor status of port number 5 on the Cisco core switch<BR>define service{<BR>use                  generic-service<BR>host_name            core-switch<BR>service_description  Port 5 Link Status<BR>check_command          check_snmp!-C public -o ifOperStatus.5 -r 1 -m RFC1213-MIB<BR>}<BR><BR># Monitor ports 1 - 6 on the Cisco core switch.<BR>define service{<BR>use                   generic-service<BR>host_name             core-switch<BR>service_description   Ports 1-6 Link Status<BR>check_command         check_snmp!-C public -o ifOperStatus.1 -r 1 -m RFC1213-MIB, -o ifOperStatus.2 -r 1 -m RFC1213-MIB, -o ifOperStatus.3 -r 1 -m RFC1213-MIB, -o ifOperStatus.4 -r 1 -m RFC1213-MIB, -o ifOperStatus.5 -r 1 -m RFC1213-MIB, -o ifOperStatus.6 -r 1 -m RFC1213-MIB<BR>}<BR><BR><BR>
<DIV><FONT color=#ff0000><STRONG>
<DIV><FONT color=#ff0000><STRONG></STRONG></FONT> </DIV></STRONG></FONT></DIV>                                         </div></body>
</html>