remote server checks via ssh

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Post Reply
elinagios
Posts: 146
Joined: Thu Feb 16, 2017 3:45 am

remote server checks via ssh

Post by elinagios »

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?
User avatar
lgute
Posts: 411
Joined: Mon Apr 06, 2020 2:49 pm

Re: remote server checks via ssh

Post by lgute »

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.
Please let us know if you have any other questions or concerns.

-Laura
elinagios
Posts: 146
Joined: Thu Feb 16, 2017 3:45 am

Re: remote server checks via ssh

Post by elinagios »

Nagiosxi Installed Version: 5.11.2, centos 7 currently, upgrading it soon.
cnorell
Developer
Posts: 141
Joined: Mon Nov 27, 2017 3:08 pm

Re: remote server checks via ssh

Post by cnorell »

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:

Code: Select all

chown nagios:nagios <plugin_name>
Best Regards,

Cory Norell
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
elinagios
Posts: 146
Joined: Thu Feb 16, 2017 3:45 am

Re: remote server checks via ssh

Post by elinagios »

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.
kg2857
Posts: 490
Joined: Wed Apr 12, 2023 5:48 pm

Re: remote server checks via ssh

Post by kg2857 »

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.
cnorell
Developer
Posts: 141
Joined: Mon Nov 27, 2017 3:08 pm

Re: remote server checks via ssh

Post by cnorell »

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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
lgute
Posts: 411
Joined: Mon Apr 06, 2020 2:49 pm

Re: remote server checks via ssh

Post by lgute »

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"?
Please let us know if you have any other questions or concerns.

-Laura
ssunga
Posts: 72
Joined: Wed Aug 09, 2023 10:38 am

Re: remote server checks via ssh

Post by ssunga »

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.
Post Reply