Can't locate Net/SNMP.pm

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
dappa_don
Posts: 8
Joined: Tue May 30, 2017 9:57 am

Can't locate Net/SNMP.pm

Post by dappa_don »

does anyone have any ideas why this is not working, i have tried multiple config on the command def and check command.

(No output on stdout) stderr: Can't locate Net/SNMP.pm in @INC (@INC contains: /usr/local/nagios/libexec /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/local/nagios/libexec/check_disk_snmp.pl line 12.

[root@nagios /]# ll /root/perl5/lib/perl5/Net/SNMP.pm
-r--r--r-- 1 root root 115525 Jun 2 15:22 /root/perl5/lib/perl5/Net/SNMP.pm

# 'check_disk_snmp.pl' command definition
define command{
command_name check_disk_snmp
command_line $USER1$/check_disk_snmp.pl -H $HOSTADDRESS$ -s xxxxxx -d /vol -w 90 -c 95
}

define service{
use storage
host_name storage
service_description volume1
servicegroups mtkstorage
check_command check_disk_snmp!
}

[root@nagios /]# /usr/local/nagios/libexec/check_disk_snmp.pl -H 192.168.x.x -s xxxxxx -d /vol -w 90 -c 95
SNMP OK - /volume1 at 37% with 3,518,188 of 5,664,039 MB free
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: Can't locate Net/SNMP.pm

Post by avandemore »

That's not an entirely valid check as the check executes usually as the user nagios:

Code: Select all

# su - nagios
$ /usr/local/nagios/libexec/check_disk_snmp.pl -H 192.168.x.x -s xxxxxx -d /vol -w 90 -c 95
Previous Nagios employee
dappa_don
Posts: 8
Joined: Tue May 30, 2017 9:57 am

Re: Can't locate Net/SNMP.pm

Post by dappa_don »

[nagios@nagios ~]$ /usr/local/nagios/libexec/check_disk_snmp.pl -H 192.168.x.x -s xxxxxx -d /vol -w 90 -c 95
Can't locate Net/SNMP.pm in @INC (@INC contains: /usr/local/nagios/libexec /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/local/nagios/libexec/check_disk_snmp.pl line 12.
BEGIN failed--compilation aborted at /usr/local/nagios/libexec/check_disk_snmp.pl line 12.

nagios@nagios ~]$ ll /usr/lib64/perl5/vendor_perl/SNMP.pm
-r--r--r-- 1 root root 80143 Oct 9 2012 /usr/lib64/perl5/vendor_perl/SNMP.pm
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Can't locate Net/SNMP.pm

Post by tgriep »

The plugin is looking for the Net/SNMP.pm module and the one in your example is not the correct one.
Try re-installing this package on the server and see if that fixes the plugin.

Code: Select all

perl-Net-SNMP
Be sure to check out our Knowledgebase for helpful articles and solutions!
dappa_don
Posts: 8
Joined: Tue May 30, 2017 9:57 am

Re: Can't locate Net/SNMP.pm

Post by dappa_don »

excellent.... thanks that did the trick.
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Can't locate Net/SNMP.pm

Post by tgriep »

Your welcome. Shall I close and lock up the post as solved for you?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked