No output returned from plugin

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
crafael01
Posts: 24
Joined: Mon Jul 15, 2013 11:28 am

No output returned from plugin

Post 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?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: No output returned from plugin

Post by lmiltchev »

Can you run the check as nagios user?

Code: Select all

su nagios -c '<full path to your command>'
Be sure to check out our Knowledgebase for helpful articles and solutions!
crafael01
Posts: 24
Joined: Mon Jul 15, 2013 11:28 am

Re: No output returned from plugin

Post 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.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: No output returned from plugin

Post by lmiltchev »

Can you show us the command and service definitions? How did you set up this check? Did you follow this document?
Be sure to check out our Knowledgebase for helpful articles and solutions!
crafael01
Posts: 24
Joined: Mon Jul 15, 2013 11:28 am

Re: No output returned from plugin

Post 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.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: No output returned from plugin

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
crafael01
Posts: 24
Joined: Mon Jul 15, 2013 11:28 am

Re: No output returned from plugin

Post 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.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: No output returned from plugin

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
crafael01
Posts: 24
Joined: Mon Jul 15, 2013 11:28 am

Re: No output returned from plugin

Post by crafael01 »

Same thing :(
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: No output returned from plugin

Post by lmiltchev »

Is "check_casper" a custom plugin? Can you provide us with a download link, so that we can test it in house?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked