SNMP polling not working as expected using OID

Hi Team,
Its noted that, i am not getting expected output in the Icinga UI with the snmp polling. I am using snmpV3 in my environment.

I am getting expected value while doing snmpwalk from the server. Please find the results below for your references:
[root@TRVUSTMMVLMON01 master]# snmpwalk -v 3 -u emadmin -a SHA -A ‘xxxxxx’ -l authPriv -x AES -X ‘xxxxxxx’ 172.21.113.66 1.3.6.1.4.1.5951.4.1.1.41.1
SNMPv2-SMI::enterprises.5951.4.1.1.41.1.0 = Gauge32: 1

[root@TRVUSTMMVLMON01 master]# snmpwalk -v 3 -u emadmin -a SHA -A ‘xxxxxxx’ -l authPriv -x AES -X ‘xxxxxxx’ 172.21.113.66 1.3.6.1.4.1.5951.4.1.1.41.2
SNMPv2-SMI::enterprises.5951.4.1.1.41.2.0 = Gauge32: 7

Attaching the error i am getting below:

Also attaching the configuration defined in services.conf:

apply Service “CPU~Usage_VPX” {
import “service_check”
check_command = “check_snmpv3”
vars.snmpv3_oid = “1.3.6.1.4.1.5951.4.1.1.41.1”
vars.snmpv3_warning = 80
vars.snmpv3_critical = 90
assign where “Citrix_VPX” in host.groups
}

apply Service “Memory~Usage_VPX” {
import “service_check”
check_command = “check_snmpv3”
vars.snmpv3_oid = “1.3.6.1.4.1.5951.4.1.1.41.2”
vars.snmpv3_warning = 80
vars.snmpv3_critical = 90
assign where “Citrix_VPX” in host.groups
}

Attaching the definition of check_snmpv3 in commands.conf:
snmpv3_commands.txt (5.3 KB)

can someone help me to resolve this issue.

Hi,

first of all you should not write passwords in a post :wink:

what is the output if you run the the check command (not snmp walk) in the bash (with the root and icinga/nagios user)? Maybe a permission error (like SELinux if turned on)

Hi @stevie-sy,

we have disabled selinux from the master server.

[root@TRVUSTMMVLMON01 plugins]# cat /etc/selinux/config

 

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

Please see the various output of the snmp walk and check_snmp:

[root@TRVUSTMMVLMON01 plugins]# snmpwalk -v 3 -u emadmin -a SHA -A ‘xxxxx’ -l authPriv -x AES -X ‘xxxxx’ 172.26.113.66 1.3.6.1.4.1.5951.4.1.1.41.1
SNMPv2-SMI::enterprises.5951.4.1.1.41.1.0 = Gauge32: 0

[root@TRVUSTMMVLMON01 plugins]# ./check_snmp -H 172.21.113.66 -P 3 -a SHA -x AES -U ‘emadmin’ -A ‘xxxxx’ -X ‘xxxxxx’ -L authPriv -o 1.3.6.1.4.1.5951.4.1.1.41.1
SNMP OK - No Such Instance currently exists at this OID |

Regards
Rajiv

Any inputs here for this issue?

Regards
Rajiv

Just a generic hint: Try executing the command as the icinga user to see problems related to permissions. That would be sudo -u icinga on CentOS etc or sudo -u nagios on debian.

Hi @lorenz,

I ran as icinga user and below is the input i am getting.

sudo -u icinga /usr/lib64/nagios/plugins/check_snmp -H 172.21.113.66 -P 3 -a SHA -x AES -U ‘emadmin’ -A ‘xxx’ -X ‘xxxx’ -L authPriv -o 1.3.6.1.4.1.5951.4.1.1.41.1
SNMP OK - No Such Instance currently exists at this OID

That’s really strange. To summerize this:

  • SELInux is disabled, so the requests can’t be blocked
  • snmpwalk works and check_snmp works not
  • You pass the same parameters

The device yo want to request: Does it have a log to see something there which could give you a hint whats wrong?

H Stevie,

I am sharing the Icinga log for references.

icinga2.log (184.4 KB)

Any help here would be highly appreciable.

I meant not the icinga2 log, I meant the device you want to check (switch, router or whatever) has maybe a log where you could see the requests from the icinga server :wink:

That the check is running successfully on your icinga server shows the output from snmpwalk and check_snmp. The only difference is here, that one catch a correct result and the other one not.

Add a .0 to the OID you are querying with the check.

As you can see the returned OID from you SNMPwalk also shows this added .0

[root@TRVUSTMMVLMON01 master]# snmpwalk -v 3 -u emadmin -a SHA -A ‘xxxxxx’ -l authPriv -x AES -X ‘xxxxxxx’ 172.21.113.66 1.3.6.1.4.1.5951.4.1.1.41.1
SNMPv2-SMI::enterprises.5951.4.1.1.41.1.0 = Gauge32: 1

Thanks @log1c for the help.

It helped.

Regards
Rajiv