Can't locate Net/SNMP.pm
Posted: Wed Oct 03, 2018 6:35 am
Hi
I setup script check_snmp_netint.pl.
Start in console from root and nagios - work.... from nagios
Write command in commands.cfg
Write service in switch.cfg
restart nagios service... not work
I have already install the library through cPAN:
from user root and from user nagios.
check from these users
check that there are packages in the system
there is no library in this place, created symlinc from user nagios
restart nagios
not work...
Help me please setup this plugin
Thx
I setup script check_snmp_netint.pl.
Start in console from root and nagios - work.
Code: Select all
[root@centos libexec]# ./check_snmp_netint.pl -H 172.**.**.2 -C public -2 -k -M -w5,5 -c8,8 -n "GigabitEthernet0/1"
GigabitEthernet0/1:UP (0.1MBps/0.0MBps):(1 UP): OK |
Code: Select all
[root@centos libexec]# su - nagios
[nagios@centos ~]$ /usr/local/nagios/libexec/check_snmp_netint.pl -H 172.**.**.2 -C public -2 -k -M -w5,5 -c8,8 -n "GigabitEthernet0/1"
GigabitEthernet0/1:UP (0.1MBps/0.1MBps):(1 UP): OK |
Code: Select all
define command {
command_name check_snmp_netint01
command_line /usr/local/nagios/libexec/check_snmp_netint.pl -H 172.**.**.2 -C public -2 -k -M -w5,5 -c8,8 -n "GigabitEthernet0/1"
}
Code: Select all
define service{
use generic-service
host_name c1921
service_description Ge0/1 Bandwidth
check_command check_snmp_netint01
}
Code: Select all
Ge0/1 Bandwidth UNKNOWN 10-03-2018 13:57:50 0d 0h 0m 18s 1/3 Can't locate Net/SNMP.pm
Code: Select all
[root@centos ~]# cpan
cpan>install Net::SNMP
check from these users
Code: Select all
[nagios@centos ~]$ perl -e "use Net::SNMP"
[nagios@centos ~]$
[root@centos ~]# perl -e "use Net::SNMP"
[root@centos ~]#
Code: Select all
yum provides '*/Net/SNMP.pm'
...
File : /usr/share/perl5/vendor_perl/Net/SNMP.pm
Code: Select all
# ln -s /home/nagios/perl5/lib/perl5/Net/SNMP.pm /usr/share/perl5/vendor_perl/Net/SNMP.pm
Code: Select all
#systemctl restart nagios
Help me please setup this plugin
Thx