Plugin ok from CLI, not ok when executed by nagios
Posted: Mon Apr 14, 2014 11:10 am
Hi,
I have the following problem. If I run a plugin from cli as nagios, it is working as expected:
nagios@monitor:/usr/local/nagios/libexec$ ./check_generic -e "/bin/sh /usr/local/nagios/libexec/checkipsload.sh" -w ">5" -c ">70" -n "IPS Inspection Load"
IPS Inspection Load WARNING - result:11 match:>5 severities:warning
But if i tell nagios to run the same plugin as a service, will return something like this:
IPS Inspection Load OK - result: match:none
I use check_generic with other personal writen scripts and is working as expected.
Can someone help me troubleshoot this problem, because i do not understand why running this plugin behaves different when invoked from cli and when invoked from nagios.
Thank you
The relevand config below:
define command{
command_name check_generic
command_line $USER1$/check_generic $ARG1$
}
define service {
use TemplateService
host_name ips1
service_description InspectionLOAD
check_command check_generic! -e "/bin/sh /usr/local/nagios/libexec/checkipsload.sh" -w ">5" -c ">70" -n "IPS Inspection Load"
}
I have the following problem. If I run a plugin from cli as nagios, it is working as expected:
nagios@monitor:/usr/local/nagios/libexec$ ./check_generic -e "/bin/sh /usr/local/nagios/libexec/checkipsload.sh" -w ">5" -c ">70" -n "IPS Inspection Load"
IPS Inspection Load WARNING - result:11 match:>5 severities:warning
But if i tell nagios to run the same plugin as a service, will return something like this:
IPS Inspection Load OK - result: match:none
I use check_generic with other personal writen scripts and is working as expected.
Can someone help me troubleshoot this problem, because i do not understand why running this plugin behaves different when invoked from cli and when invoked from nagios.
Thank you
The relevand config below:
define command{
command_name check_generic
command_line $USER1$/check_generic $ARG1$
}
define service {
use TemplateService
host_name ips1
service_description InspectionLOAD
check_command check_generic! -e "/bin/sh /usr/local/nagios/libexec/checkipsload.sh" -w ">5" -c ">70" -n "IPS Inspection Load"
}