Snmp_check command not working: "failed object"

I’m attempting to configure check_snmp commands for a host. I’ve defined a check in the commands and services configuration files and applied them to the host. After configuring, the plugin output on the web interface for this check is the following:

External command error: /usr/share/snmp/mibs/SONICWALL-FIREWALL-TRAP-MIB.MIB: Permission denied
/usr/share/snmp/mibs/SW-SMI.MIB: Permission denied
/usr/share/snmp/mibs/SNWL-COMMON-MIB.MIB: Permission denied
/usr/share/snmp/mibs/SONICWALL-FIREWALL-IP-STATISTICS-MIB.MIB: Permission denied
/usr/share/snmp/mibs/SONICWALL-SMI.MIB: Permission denied
Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: SNMPv2-SMI::enterprises.

The OID in question shows up just fine when running an snmpwalk for the host on my icinga server. I have the associated MIBs installed on the server as well.
The check command is defined in my commands.conf file as such:

object CheckCommand “PS2-Status” {
import “plugin-check-command”
command = [ PluginDir + “/check_snmp” ]
arguments = {
“-H” = “$address$”
“-C” = “$community$”
“-o” = “.”
“-w” = “3”
} = “$community$”

The service for this command is defined in my services.conf file as such:

apply Service “Chassis-PS2-Status” {
import “generic-service”
check_command = “PS2-Status”
display_name = “Chassis Power Supply 2 Status”
assign where == “Dell-EMC-ML3-TapeLibrary”

What could be causing this error and how do I resolve it?

I’d assume you are logged in as root when you run snmpwalk. icinga executes the check as user nagios or icinga (depending on your distribution) and this user obviously does not have sufficient access rights.
Testing snmpwalk as user nagios or icinga could be done with sudo:

sudo -u nagios snmpwalk …

1 Like

snmpwalk on this device can be performed as the icinga user. There are other devices in our organization being monitored using the check_snmp plugin that don’t have any problems.

I’ve discovered what was causing the error. Upon re-examining the results of my initial snmpwalk, I noticed that the OID in question had another number appended to it that didn’t match what I had seen in the MIB. After adding this number at the end of the OID in my commands.conf file, the snmp check works just fine.

1 Like