Page 1 of 1

Issue with plugins

Posted: Mon Jun 06, 2016 7:57 am
by developerx9
Hi,

We are currently migrating our hosts from 2012.R9 to the latest version of nagios.
We have a bunch of custom checks, and it appears most of them (all of them?) are failing.

example:
(No output on stdout) stderr: execvp(/usr/local/nagios/libexec/check_json, ...) failed. errno is 2: No such file or directory

Even though:

# ls -lah /usr/local/nagios/libexec/check_json
-rwxr-xr-x 1 apache nagios 2,4K Svi 6 2015 /usr/local/nagios/libexec/check_json


In the commands conf we have:

define command {
command_name check_json
command_line $USER1$/check_json -h $HOSTADDRESS$ -p $ARG1$ -u $ARG2$
}


And service is defined within the hosts properly.

When I execute it via command line, it works fine:

root@nagios:/usr/local/nagios/libexec
# ruby ./check_json -h 10.11.12.13 -p 8080 -u /check
Service is running


Not sure what's the issue here. Any help would be appreciated.

Re: Issue with plugins

Posted: Mon Jun 06, 2016 9:30 am
by developerx9
So, this happened.

This is a ruby script, and location was specified as "#!/usr/local/bin/ruby" , while this machine was running /usr/bin/ruby.
Error is kind of misleading imho, but at least we figured it out.

Re: Issue with plugins

Posted: Mon Jun 06, 2016 10:00 am
by hsmith
Thanks for letting us know what the fix was. Would you like us to close this thread?

Re: Issue with plugins

Posted: Wed Jun 08, 2016 9:28 am
by developerx9
Hi,

Sorry for the late reply.
Sure thing - it's resolved now.

Re: Issue with plugins

Posted: Wed Jun 08, 2016 9:37 am
by mcapra
Closing this up!