We've moved to a new support system!

The Nagios Answer Hub is a place where you can get help with technical questions from our experts. There, you can quickly open tickets and join discussion boards.

Request Nagios Answer Hub access here: https://info.nagios.com/answer-hub-access-new-users

After completing the access form, you will be given access to a portal where new tickets can be created. We will keep the old customer forum sections and ticket system available for current cases to be resolved.

Go to the Answer Hub

snmp_check not working with text OID after CPAN installation

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

snmp_check not working with text OID after CPAN installation

Postby mlazzarotto » Tue Feb 22, 2022 6:26 am

Hi, yesterday I was adding some firewalls on my Nagios.
I added successfully a SonicWall SMA virtual appliance using several SNMP checks, and that was working fine until yesterday at around 10:45.
Note that I copied related MIBs to /usr/share/snmp/mib folder.

My linux history shows that at that time I executed the command CPAN. I had to use CPAN to install Nagios::Plugin but it failed, then I tried Monitoring::Plugin and it failed as well. Lastly, I did yum install perl-Nagios-Plugin (removed today to try to solve my problem).
This was needed to check a Cisco ASR router.

Today I checked Nagios and turns out that all the checks returns
CRITICAL - Plugin timed out while executing system call

My snmp_check command:
Code: Select all
define command{
        command_name    check_snmp
        command_line    $USER1$/check_snmp -H $HOSTADDRESS$ $ARG1$
        }


and this is one of the checks for that SMA appliance
Code: Select all
define service{
        use                    generic-service
        host_name                 <redacted>
        service_description       Uptime
        check_command             check_snmp!-C ReAD_oNly -o sysUpTime.0
}


if I manually execute the command, this shows:
Code: Select all
[root@server ~]# /usr/local/nagios/libexec/check_snmp -H 10.1.1.235 -C ReAD_oNly -o sysUpTime.0  -v
/usr/bin/snmpget -Le -t 3 -r 5 -m ALL -v 1 [context] [authpriv] 10.1.1.235:161 sysUpTime.0
CRITICAL - Plugin timed out while executing system call


but when I use the numeric OID instead, it works fine
Code: Select all
[root@server ~]# /usr/local/nagios/libexec/check_snmp -H 10.1.1.235 -C ReAD_oNly -o .1.3.6.1.4.1.8741.6.2.1.7.0  -v
/usr/bin/snmpget -Le -t 3 -r 5 -m '' -v 1 [context] [authpriv] 10.1.1.235:161 .1.3.6.1.4.1.8741.6.2.1.7.0
iso.3.6.1.4.1.8741.6.2.1.7.0 = STRING: "62 Days 04:03:50"
SNMP OK - "62 Days 04:03:50" |


check_snmp v2.3.3 (nagios-plugins 2.3.3)
mlazzarotto
 
Posts: 5
Joined: Wed Apr 28, 2021 4:00 am

Re: snmp_check not working with text OID after CPAN installa

Postby gormank » Tue Feb 22, 2022 1:39 pm

Maybe try check_snmp --verbose or -v to see if that tells you more. All I can think of is that the MIB can't be read by the nagios user. I don't see how the other things can impact testing from the shell.
gormank
 
Posts: 992
Joined: Tue Dec 02, 2014 12:00 pm

Re: snmp_check not working with text OID after CPAN installa

Postby mlazzarotto » Wed Feb 23, 2022 11:48 am

gormank wrote:Maybe try check_snmp --verbose or -v to see if that tells you more. All I can think of is that the MIB can't be read by the nagios user. I don't see how the other things can impact testing from the shell.

As you can see the in the fourth code block I'm already using check_snmp with -v option
mlazzarotto
 
Posts: 5
Joined: Wed Apr 28, 2021 4:00 am

Re: snmp_check not working with text OID after CPAN installa

Postby gormank » Wed Feb 23, 2022 1:26 pm

Maybe try setting -m SNMPv2-MIB.mib in the command, and make sure SNMPv2-MIB.mib is in the mibs dir?

-m, --miblist=STRING
List of MIBS to be loaded (default = none if using numeric OIDs or 'ALL'
for symbolic OIDs.)
gormank
 
Posts: 992
Joined: Tue Dec 02, 2014 12:00 pm

Re: snmp_check not working with text OID after CPAN installa

Postby mlazzarotto » Fri Feb 25, 2022 5:52 am

gormank wrote:Maybe try setting -m SNMPv2-MIB.mib in the command, and make sure SNMPv2-MIB.mib is in the mibs dir?

-m, --miblist=STRING
List of MIBS to be loaded (default = none if using numeric OIDs or 'ALL'
for symbolic OIDs.)


Hey! Thank you sir! Specifying SNMPv2-MIB.txt did the trick (I'm curious why, though).
mlazzarotto
 
Posts: 5
Joined: Wed Apr 28, 2021 4:00 am


Return to Community Support

Who is online

Users browsing this forum: No registered users and 25 guests