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
Can't locate Net/SNMP.pm
-
- Posts: 1597
- Joined: Tue Sep 27, 2016 4:57 pm
Re: Can't locate Net/SNMP.pm
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
Re: Can't locate Net/SNMP.pm
[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
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
Re: Can't locate Net/SNMP.pm
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.
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!
Re: Can't locate Net/SNMP.pm
excellent.... thanks that did the trick.
Re: Can't locate Net/SNMP.pm
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!