Cannot run check_snmp_storage.pl

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
NagiosNewbis
Posts: 24
Joined: Thu May 02, 2013 5:13 pm

Cannot run check_snmp_storage.pl

Post by NagiosNewbis »

Hello;

I want to use check_snmp_storage.pl to detect my remote linux server but I got the following error when I issue the command "perl ./check_snmp_storage.pl -H 192.168.0.100 -C public -m zzzz -w 80 -c 81 -v

error msg is...

Can't locate Net/SNMP.pm in @INC (@INC contains: /usr/local/lib/perl5 /usr/local/share/perl5 / usr/lib/perl5/vendor_perl....) at ./check_snmp_storage.pl line 15

But, I can find my SNMP.pm file in /usr/lib/perl5/vendor_perl folder.

I used the check_snmp -H 192.168.0.100 -C public -o sysUpTimeInstance to detect my remote linux server, and I receive the response like "SNMP OK -" which mean the communication is fine.

Can some one let me know what's wrong.
dihavs
Posts: 5
Joined: Fri May 10, 2013 5:50 am

Re: Cannot run check_snmp_storage.pl

Post by dihavs »

Code: Select all

perl -MCPAN -e shell
install Net::SNMP
NagiosNewbis
Posts: 24
Joined: Thu May 02, 2013 5:13 pm

Re: Cannot run check_snmp_storage.pl

Post by NagiosNewbis »

Hi;

After install those components, I can run the check_snmp_storage.pl from the command line but how can I put it into my linux.cfg file for Nagios?

define service{
use local-service
host_name myLinux
service_description Check space usage
check_command check_snmp_storage
command_line check_snmp_storage.pl -H 192.168.30.17 -C public -$ -m ALL -w 70% -c 80%
}

When I run the verify command, I got this error

Error: Invalid service object directive 'command_line'.
Error: Could not add object property in file '/usr/local/nagios/etc/objects/linux.cfg' on line 125.
Error processing object config files!
NagiosNewbis
Posts: 24
Joined: Thu May 02, 2013 5:13 pm

Re: Cannot run check_snmp_storage.pl

Post by NagiosNewbis »

I got it up and running after I modified my commands.cfg and the linux.cfg files.

I added the following command to the commands.cfg file

# check host storage
define command{
command_name check_snmp_storage
command_line /usr/bin/perl -w $USER1$/check_snmp_storage.pl -H $HOSTADDRESS$ -C public -m -w 70% -c 80%
}

and remove the command_line syntax in the linux.cfg file in define service {...} section.

Now, my result showing this in my Nagios Core web interface, I want to monitor my /home only.

Virtual memory: 60%used(7036MB/11649MB) Swap space: 1%used(54MB/3888MB) /dev/shm: 0%used(0MB/3880MB) Memory buffers: 4%used(276MB/7761MB) Physical memory: 90%used(6983MB/7761MB) /boot: 8%used(36MB/484MB) Cached memory: 100%used(512MB/512MB) /home: 61%used(74552MB/121668MB) /: 4%used(2227MB/50397MB) (>80%) : CRITICAL
NagiosNewbis
Posts: 24
Joined: Thu May 02, 2013 5:13 pm

Re: Cannot run check_snmp_storage.pl

Post by NagiosNewbis »

If I want to monitor the usage of entire sda3, what command should be used?
User avatar
nscott
Posts: 1040
Joined: Wed May 11, 2011 8:54 am

Re: Cannot run check_snmp_storage.pl

Post by nscott »

You should be posting this in either Nagios Core and Nagios XI forums, depending on your flavor.
Nicholas Scott
Former Nagios employee
Locked