Alert if a Service IS running
Posted: Wed Sep 09, 2015 6:59 am
Good afternoon,
I created a command in commands.cfg
to allow Nagios to generate an alert if a particular application WAS running, rather than if it wasn't:
and this runs fine. Now I want to extend this functionality to alert when a SERVICE is running, but when I use this:
the browser returns "check_nt: Could not parse arguments "
Do I need to create a different negate command that will work with services, rather than applications?
[EDIT] - another typo - I had a space between the "-" and the "v" above, although it's not easy to spot. Removed it, restarted and all is fine!
Pete
I created a command in commands.cfg
Code: Select all
define command {
command_name negatepr
command_line $USER1$/negate $USER1$/$ARG1$
}
Code: Select all
#define service{
# use generic-service
# hostgroup_name jenkins-test-masters,jenkins-slaves
# service_description Alert if running - Notepad
# check_command negatepr!check_nt -H $HOSTADDRESS$ -p 12489 -v PROCSTATE -d SHOWALL -l notepad.exe
# }
Code: Select all
define service{
use generic-service
hostgroup_name jenkins-test-masters
service_description Service active - Tomcat7
check_command negatepr!check_nt -H $HOSTADDRESS$ -p 12489 - v SERVICESTATE -d SHOWALL -l Tomcat7
}
Do I need to create a different negate command that will work with services, rather than applications?
[EDIT] - another typo - I had a space between the "-" and the "v" above, although it's not easy to spot. Removed it, restarted and all is fine!
Pete