Page 1 of 2

No output returned from plugin

Posted: Tue May 06, 2014 12:44 pm
by crafael01
I set up a check and when I run it from the command line I get data returned, but when I run it in Nagios I get (No output returned from plugin).

Here's the command line I got from Nagios when I test the config:
/usr/local/nagios/libexec/check_casper script.js /usr/local/nagios/libexec/admin_ui-stage.js

This is what is returned from the command line:
PASS 3 tests executed in 2.398s, 3 passed, 0 failed, 0 dubious, 0 skipped.

And the exit code:
echo $?
0

Any idea's why this is happening or how I should go about troubleshooting?

Re: No output returned from plugin

Posted: Tue May 06, 2014 12:54 pm
by lmiltchev
Can you run the check as nagios user?

Code: Select all

su nagios -c '<full path to your command>'

Re: No output returned from plugin

Posted: Tue May 06, 2014 1:27 pm
by crafael01
su nagios -c /usr/local/nagios/libexec/check_casper script.js /usr/local/nagios/libexec/admin_ui-stage.js
PASS 3 tests executed in 7.342s, 3 passed, 0 failed, 0 dubious, 0 skipped.

same thing.

Re: No output returned from plugin

Posted: Tue May 06, 2014 2:05 pm
by lmiltchev
Can you show us the command and service definitions? How did you set up this check? Did you follow this document?

Re: No output returned from plugin

Posted: Tue May 06, 2014 3:17 pm
by crafael01
define command {
command_name check_casper3
command_line $USER1$/check_casper $ARG1$ $ARG2$
}

define service {
host_name www-xxx.xxx.com
service_description HTTP - IAM User Mgt UI VIP Login - DIT
use generic-service-active
check_command check_casper3!script.js!/usr/local/nagios/libexec/admin_ui-stage.js !!!!!!
register 1
}

Not sure where those extra bangs came in, something added from the GUI i guess.

Re: No output returned from plugin

Posted: Tue May 06, 2014 4:37 pm
by Box293
The only thing I can spot is in your service definition is a space between admin_ui-stage.js and !.

check_command check_casper3!script.js!/usr/local/nagios/libexec/admin_ui-stage.jsspace!!!!!!

It shouldn't make a difference but I've see stranger things happen.

Re: No output returned from plugin

Posted: Tue May 06, 2014 5:18 pm
by crafael01
I acutally had to remove a little text from there, but besides what I removed for privacy reasons, the check is basically the same.

Re: No output returned from plugin

Posted: Tue May 06, 2014 7:25 pm
by Box293
If $ARG2$ is populated with spaces then your command definintion will need quotes to enclose the argument.

Code: Select all

\"$ARG2$\"
For example:

Code: Select all

define command {
command_name check_casper3
command_line $USER1$/check_casper $ARG1$ \"$ARG2$\"
} 
See how that goes.

Re: No output returned from plugin

Posted: Thu May 08, 2014 10:15 am
by crafael01
Same thing :(

Re: No output returned from plugin

Posted: Thu May 08, 2014 12:25 pm
by lmiltchev
Is "check_casper" a custom plugin? Can you provide us with a download link, so that we can test it in house?