Hello
i have a service that ssh to another server, runs a script there and reports back the result.
Now when i run the the command in cli, it always answers really quick correct answer, when i run the command in service "Run Check Command" the answer is always correct and fast. Now when the services are run normally or when i run Force immediate check, it rather often answers: (No output returned from plugin)
the plugin rights -rwxrwxr-x 1 apache nagios
I tried to set high timeout also, doesnt help, because the no output is answered in normal time. any suggestion what to check?
remote server checks via ssh
Re: remote server checks via ssh
Hi @elinagios, thanks for reaching out.
Are you using Nagios Core or XI? It may also be helpful if you could tell us which version and which distro & version you are using.
Are you using Nagios Core or XI? It may also be helpful if you could tell us which version and which distro & version you are using.
Please let us know if you have any other questions or concerns.
-Laura
-Laura
Re: remote server checks via ssh
Nagiosxi Installed Version: 5.11.2, centos 7 currently, upgrading it soon.
Re: remote server checks via ssh
elinagios,
When running the plugin from the command line, are you running it as the nagios user?
If you are and it's working as expected, you could try to update the owner to be nagios rather than apache:
Best Regards,
Cory Norell
When running the plugin from the command line, are you running it as the nagios user?
If you are and it's working as expected, you could try to update the owner to be nagios rather than apache:
Code: Select all
chown nagios:nagios <plugin_name>Cory Norell
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: remote server checks via ssh
Sadly it didnt help, changing the ownership to nagios:nagios.
From cli i was running it from user nagios, yes.
From cli and core config manager, services, Run check command always succeeds. The check run as normal check(force immediate check), mostly replies back (No output returned from plugin) but sometimes also succeeds.
From cli i was running it from user nagios, yes.
From cli and core config manager, services, Run check command always succeeds. The check run as normal check(force immediate check), mostly replies back (No output returned from plugin) but sometimes also succeeds.
Re: remote server checks via ssh
No output means there was nothing on stdout. It doesn't mean there was an error running the plugin. Nagios reads stdout and the return value of the plugin. Stderr means nothing.
Redirect stderror to /dev/null or and see what you see.
Redirect stderror to /dev/null or and see what you see.
Re: remote server checks via ssh
Perhaps I made a bad assumption in assuming the plugin was already outputting to stdout. If it's not, that very well could be your issue.
For posterity's sake, here's a link to the plugin development guidelines.
For posterity's sake, here's a link to the plugin development guidelines.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: remote server checks via ssh
Hi @elinagios,
Have you checked the log files to see if any errors are getting logged, when you are seeing "No output returned from plugin"?
Have you checked the log files to see if any errors are getting logged, when you are seeing "No output returned from plugin"?
Please let us know if you have any other questions or concerns.
-Laura
-Laura
Re: remote server checks via ssh
To add onto @kg2857's point, you can redirect the output with
./plugin 2>/dev/null
You should check (like laura said)nagios logs/execution permissions/see if the plugin is writing to stdout in all execution paths.
./plugin 2>/dev/null
You should check (like laura said)nagios logs/execution permissions/see if the plugin is writing to stdout in all execution paths.