Monitor QNAP disk space in Nagios

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.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Monitor QNAP disk space in Nagios

Post by slansing »

What is the output of:

Code: Select all

ll /usr/share/perl5/Net/SNMP.pm
ll /usr/share/perl5/strict.pm

Code: Select all

ll /usr/share/perl5/constant.pm
imran_khan
Posts: 196
Joined: Mon May 27, 2013 3:16 pm

Re: Monitor QNAP disk space in Nagios

Post by imran_khan »

Hello,

Thanks for the reply. Please find the output.

[root@localhost Net]# ll /usr/share/perl5/constant.pm
-rw-r--r-- 1 root root 12528 Nov 22 2013 /usr/share/perl5/constant.pm

[root@localhost libexec]# ll /usr/share/perl5/Net/SNMP.pm
ls: cannot access /usr/share/perl5/Net/SNMP.pm: No such file or directory

[root@localhost libexec]# ll /usr/share/perl5/strict.pm
-rw-r--r-- 1 root root 3716 Nov 22 2013 /usr/share/perl5/strict.pm


Net::SNMP is installed in the system.

[root@localhost ~] instmodsh
Available commands are:
l - List all installed modules
m <module> - Select a module
q - Quit the program
cmd? l
Installed modules are:

Net::SNMP

Thanks,
Imran Khan.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Monitor QNAP disk space in Nagios

Post by sreinhardt »

Well it may say its installed, but the files certainly do not appear in normal perl paths. Let's see if we can't find it.

Code: Select all

find / -name SNMP.pm
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
imran_khan
Posts: 196
Joined: Mon May 27, 2013 3:16 pm

Re: Monitor QNAP disk space in Nagios

Post by imran_khan »

Hello,

Thanks for the reply. Getting below output.

[root@localhost ~]# find / -name SNMP.pm
/root/.cpan/build/Net-SNMP-v6.0.1-Ai1_Te/lib/Net/SNMP.pm
/root/.cpan/build/Net-SNMP-v6.0.1-Ai1_Te/blib/lib/Net/SNMP.pm
/usr/local/share/perl5/Net/SNMP.pm

Thanks,
Imran Khan.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Monitor QNAP disk space in Nagios

Post by sreinhardt »

Looks like you have a version of net-snmp, and it is placed within a valid perl path location. Let's check permissions on it:

Code: Select all

ll -lva /usr/local/share/perl5/Net/SNMP.pm
ll -lva /usr/local/share/perl5/Net -d
ll -lva /usr/local/share/perl5/ -d
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
imran_khan
Posts: 196
Joined: Mon May 27, 2013 3:16 pm

Re: Monitor QNAP disk space in Nagios

Post by imran_khan »

Hello,

Please find the output.

[root@localhost ~]# ll -lva /usr/local/share/perl5/Net/SNMP.pm
-r--r--r-- 1 root root 115525 Sep 9 2010 /usr/local/share/perl5/Net/SNMP.pm

[root@localhost ~]# ll -lva /usr/local/share/perl5/Net -d
drwxr-xr-x 4 root root 4096 Jul 20 02:24 /usr/local/share/perl5/Net

[root@localhost ~]# ll -lva /usr/local/share/perl5/ -d
drwxr-xr-x 43 root root 4096 Jul 20 03:10 /usr/local/share/perl5/

Thanks,
Imran Khan.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Monitor QNAP disk space in Nagios

Post by sreinhardt »

Wow 2010, that looks pretty old. Let's take a look at what version you have.

Code: Select all

rpm -qa | grep perl-Net-SNMP
yum list installed | grep perl-Net-SNMP
yum info perl-Net-SNMP
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
imran_khan
Posts: 196
Joined: Mon May 27, 2013 3:16 pm

Re: Monitor QNAP disk space in Nagios

Post by imran_khan »

Hello,

Showing perl-Net-SNMP rpm is not installed on the system

[root@localhost ~]# yum list installed | grep perl-Net-SNMP
[root@localhost ~]# yum info perl-Net-SNMP
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.mirror.constant.com
* extras: mirror.cs.vt.edu
* updates: mirror.metrocast.net
base | 3.7 kB 00:00
extras | 3.3 kB 00:00
updates | 3.4 kB 00:00
updates/primary_db | 5.4 MB 00:02
Error: No matching Packages to list

Thanks,
Imran Khan.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Monitor QNAP disk space in Nagios

Post by sreinhardt »

I believe you said this was Cent\RHEL 6 before, so you are going to need the rpmforge repository. Try the following:

Code: Select all

cd /tmp
wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
rpm -Uvh rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
rm -rf rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
yum install perl-Net-SNMP -y
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
imran_khan
Posts: 196
Joined: Mon May 27, 2013 3:16 pm

Re: Monitor QNAP disk space in Nagios

Post by imran_khan »

Hello,

Installed perl-Net-SNMP RPM on the server but still getting same error.

[root@localhost libexec]# rpm -qa | grep perl-Net-SNMP
perl-Net-SNMP-5.2.0-1.2.el6.rf.noarch

[root@localhost libexec]# ./check_qnap_volumes --help
Can't locate SNMP.pm in @INC (@INC contains: /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 ./check_qnap_volumes line 29.
BEGIN failed--compilation aborted at ./check_qnap_volumes line 29.

Thanks,
Imran Khan.
Locked