Hi
I have just started using the pearl script check_snmp_stoarge which seems to be a much better script and will offer more options on things I can check suck as memory if I would like
For now would someone be able to point me in the direction of what my command definition and service definition would be if I wanted to check the disk space only of all drives on any given host.
Thanks in advance
Nagios returns service did not exit properly
-
- Posts: 8
- Joined: Mon Apr 14, 2014 8:57 am
Re: Nagios returns service did not exit properly
You could have a command like:
In the service definition you could have the following line:
For Windows check:
if you are monitoring "C:" and "D:" drives only.
For Linux check:
Here's an example of the plugin's usage:
Hope this helps.
Code: Select all
define command {
command_name check_snmp
command_line $USER1$/check_snmp_storage.pl -H $HOSTADDRESS$ $ARG1$
}
For Windows check:
Code: Select all
check_command check_snmp! -C community --v2c -m "^[CD]:" -w 80 -c 95 -f
For Linux check:
Code: Select all
check_command check_snmp! -C community --v2c -m "^/" -w 80 -c 95 -f
You can view the usage by going to:example :
Browse storage list : <script> -C <community> -H <host> -m <anything> -w 1 -c 2 -v
the -m option allows regexp in perl format :
Test drive C,F,G,H,I on Windows : -m ^[CFGHI]:
Test all mounts containing /var : -m /var
Test all mounts under /var : -m ^/var
Test only /var : -m /var -r
Test all swap spaces : -m ^Swap
Test all but swap spaces : -m ^Swap -e
Code: Select all
/usr/local/nagios/libexec/check_snmp_storage.pl -h
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
- Posts: 8
- Joined: Mon Apr 14, 2014 8:57 am
Re: Nagios returns service did not exit properly
Hi
So I have created the following command
With the following service
How ever my nagios verification fails with the following error
Error: Service check command 'check_snmp_storage.pl -C public -m ^[C]: -w 90 -c 95 -v' specified in service 'Check-SNMP-Storagey' for host 'VSHMANHOST' not defined anywhere!
This errors for every host so currently have 9 errors the same
Any thoughts on where I may be going wrong
Apologies again for being quite the nagios noob
Thanks in advance
So I have created the following command
Code: Select all
define command{
command_name check_snmp_storage
command_line /usr/lib/nagios/plugins/check_snmp_storage.pl -H $HOSTADDRESS$ $ARG1$
}
Code: Select all
define service {
hostgroup_name netbios-ssn
service_description Check-SNMP-Storagey
check_command check_snmp_storage.pl -C public -m ^[C]: -w 90 -c 95 -v
use generic-service
notification_interval 0 ; set > 0 if you want to be renotified
}
Error: Service check command 'check_snmp_storage.pl -C public -m ^[C]: -w 90 -c 95 -v' specified in service 'Check-SNMP-Storagey' for host 'VSHMANHOST' not defined anywhere!
This errors for every host so currently have 9 errors the same
Any thoughts on where I may be going wrong
Apologies again for being quite the nagios noob
Thanks in advance
-
- Posts: 8
- Joined: Mon Apr 14, 2014 8:57 am
Re: Nagios returns service did not exit properly
Hi
I managed to solve this. The command and service code I used are the following:
This is now working for me now. Much better script then the one I originally started with.
Thanks
I managed to solve this. The command and service code I used are the following:
Code: Select all
define command{
command_name check_snmp_storage
command_line $USER1$/check_snmp_storage.pl -H $HOSTADDRESS$ -C $ARG1$ -m $ARG2$ -w $ARG3$ -c $ARG4$
}
Code: Select all
define service {
hostgroup_name netbios-ssn
service_description Check-SNMP-Storagey
check_command check_snmp_storage!public!^[C]:!90!95
use generic-service
notification_interval 0 ; set > 0 if you want to be renotified
}
Thanks
Re: Nagios returns service did not exit properly
Good to hear. Gonna lock this one up now.
Former Nagios employee