0

I’m trying to check the uptime of a Cisco 2960X switch on Nagios with check_snmp plugin but I always get the following error:

[root@nagios]# /usr/lib64/nagios/plugins/check_snmp -P 3 -U snmpv3user -L authPriv -a MD5 -A v3p4ssword#1 -x DES -X v3p4ssword#2 -H 192.168.254.2 -o DISMAN-EVENT-MIB::sysUpTimeInstance

External command error: snmpget: Authentication failure (incorrect password, community or key)

I get the same error on nagios web console.

My switches.conf is like this:

define host{

    use                     generic-switch,host-pnp
    host_name               cisco_2960x_IT2_Datacenter
    alias                   cisco 2960x 24p IT2 Datacenter
    address                 192.168.254.2
    hostgroups              switches_v3
    notification_interval   60
    icon_image              switch.png
    statusmap_image         switch40.png
    }

define hostgroup{

    hostgroup_name  switches                ; The name of the hostgroup
    alias           Network Switches        ; Long name of the group
    }

define hostgroup{

    hostgroup_name  switches_v3             ; The name of the hostgroup
    alias           Network Switches with SNMP v3        ; Long name of the group
    }

define service { 

    use                     generic-service
    hostgroup_name          switches_v3
    service_description     Uptime
    check_command           check_snmp!-P 3 -U snmpv3user -L authPriv -a MD5 -A v3p4ssword#1 -x DES -X v3p4ssword#2 -o DISMAN-EVENT-MIB::sysUpTimeInstance

}

If I do the same test with snmpget, everything runs fine:

[root@nagios]# snmpget -v3 -l authPriv -u snmpv3user -a MD5 -A v3password#1 -x DES -X v3password#2 192.168.254.2 DISMAN-EVENT-MIB::sysUpTimeInstance

DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (783093831) 90 days, 15:15:38.31

snmpwalk also runs without problems:

[root@nagios]# snmpwalk -v3 -l authPriv -u snmpv3user -a MD5 -A v3password#1 -x DES -X v3password#2 192.168.254.8 DISMAN-EVENT-MIB::sysUpTimeInstance

DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (783167495) 90 days, 15:27:54.95

Do you have any idea of what might be happening? I’m using a FAN installation on Centos.

[root@nagios]# uname -a Linux nagios 2.6.18-400.1.1.el5 #1 SMP Thu Dec 18 00:59:53 EST 2014 x86_64 x86_64 x86_64 GNU/Linux

Thanks in advance for your help!

Cheers!

Keith
  • 4,627
  • 14
  • 25
  • can you try setting the password to something simple, without punctuation? and report what happens – Keith Jul 07 '15 at 18:12
  • Hi Keith.Thanks for the fast reply. I changed the password to a simple password but no luck... – Pedro Roeseler Jul 08 '15 at 14:06
  • I noticed that I have an older version of nagios plugins. I will try to update them to see if there's any difference. – Pedro Roeseler Jul 08 '15 at 14:07
  • updated plugin but no luck. – Pedro Roeseler Jul 08 '15 at 14:19
  • Since snmpget works great from the shell, is it possible to use it instead of check_snmp on the switch.conf? Something like: define service { use generic-service hostgroup_name switches_v3 service_description Uptime check_command /usr/bin/snmpget!-v 3 -l authPriv -u snmpv3user -a SHA -A v3password1 -x AES -X v3password2 192.168.254.2 sysUpTime.0 } If it is possible, do I have to change anything on the commands.cfg? – Pedro Roeseler Jul 09 '15 at 10:10

0 Answers0