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.
Cannot run check_snmp_storage.pl
Re: Cannot run check_snmp_storage.pl
Code: Select all
perl -MCPAN -e shell
install Net::SNMP
-
- Posts: 24
- Joined: Thu May 02, 2013 5:13 pm
Re: Cannot run check_snmp_storage.pl
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!
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!
-
- Posts: 24
- Joined: Thu May 02, 2013 5:13 pm
Re: Cannot run check_snmp_storage.pl
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
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
-
- Posts: 24
- Joined: Thu May 02, 2013 5:13 pm
Re: Cannot run check_snmp_storage.pl
If I want to monitor the usage of entire sda3, what command should be used?
Re: Cannot run check_snmp_storage.pl
You should be posting this in either Nagios Core and Nagios XI forums, depending on your flavor.
Nicholas Scott
Former Nagios employee
Former Nagios employee