check_snmp fails in nagios when using MIB

Engage with the community of users including those using the open source solutions.
Includes Nagios Core, Plugins, and NCPA

check_snmp fails in nagios when using MIB

Postby wastedcosmonaut » Mon Aug 30, 2021 5:43 pm

Running check_snmp manually, the following succeeds:
/usr/lib64/nagios/plugins/check_snmp -o tlpUpsOutputSource.1 -H UPShostname.com -m $USER1$/TRIPPLITE-PRODUCTS.MIB -R '3|9' -vvv
Code: Select all
/usr/bin/snmpget -Le -t 3 -r 5 -m /root/.snmp/TRIPPLITE-PRODUCTS.MIB -v 1 [context] [authpriv] UPShostname.com:161 tlpUpsOutputSource.1
TRIPPLITE-PRODUCTS::tlpUpsOutputSource.1 = INTEGER: economy(9)
Processing oid 1 (line 1)
  oidname: TRIPPLITE-PRODUCTS::tlpUpsOutputSource.1
  response: INTEGER: economy(9)
SNMP OK - economy(9) |

Crits when supposed to, OKs when supposed to (Status 3 or 9)

But when added as a check_command in Nagios Core 4.4, it fails. "critical - plugin timed out while executing system call"

If I remove the mib and use the oid instead of the name, it works. But this doesn't provide the labels. (Normal, bypass, etc)

Any idea why?
wastedcosmonaut
 
Posts: 2
Joined: Mon Aug 30, 2021 5:35 pm

Re: check_snmp fails in nagios when using MIB

Postby gormank » Tue Aug 31, 2021 11:30 am

I'd guess Nagios can't access root's home dir so the check fails using the MIB.
/usr/bin/snmpget -Le -t 3 -r 5 -m /root/.snmp/TRIPPLITE-PRODUCTS.MIB
gormank
 
Posts: 901
Joined: Tue Dec 02, 2014 12:00 pm

Re: check_snmp fails in nagios when using MIB

Postby wastedcosmonaut » Thu Sep 02, 2021 9:28 pm

gormank wrote:I'd guess Nagios can't access root's home dir so the check fails using the MIB.
/usr/bin/snmpget -Le -t 3 -r 5 -m /root/.snmp/TRIPPLITE-PRODUCTS.MIB


When Nagios runs the command, it did error with "No permission to access file" or something. I moved the MIB into $USER1$ and adjusted the command, which lead to this error. Nagios does have permission for where the file is now. So that's not the problem, as far as I can tell.
wastedcosmonaut
 
Posts: 2
Joined: Mon Aug 30, 2021 5:35 pm

Re: check_snmp fails in nagios when using MIB

Postby gormank » Thu Sep 09, 2021 11:22 am

I think the MIB dir is /usr/share/snmp/mibs/.
Can you post the command and output when run as the nagios user, and the contents of the service .cfg file?
gormank
 
Posts: 901
Joined: Tue Dec 02, 2014 12:00 pm


Return to Community Support

Who is online

Users browsing this forum: Majestic-12 [Bot] and 26 guests