Page 1 of 1

Bandwidth test and No output returned from plugin

Posted: Fri Mar 09, 2018 2:04 pm
by rdubya
Core 4.1.1 on Centos 6.7

I've dropped this;
https://exchange.nagios.org/directory/P ... ta/details
...into place today and have been stumped by something that's probably simpler than I'm making it.

Here's the what I have in commands.cfg;

Code: Select all

define command {
       command_name    check_speed
       command_line    $USER1$/check_speed.sh -H $HOSTADDRESS$ -s $ARG1$ -d $ARG2$ -r $ARG3$
}
Here's what I have in localhost.cfg

Code: Select all

define service{
   use                  generic-service,nagiosgraph
   host_name            engmon ; The name of the host the service is associated with
   service_description  Check Bandwidth from Engmon to Wal-NFSserver      ; The service description
   check_command        check_speed! -H wal-nfsserver -s 5120 -d /home/engops/xfer_data -r /home/engops/xfer_data
   }
The command runs fine from the command line;

Code: Select all

[root@engmon objects]# /usr/local/nagios/libexec/check_speed.sh -H wal-nfsserver -s 5120  -d /home/engops/xfer_data -r /home/engops/xfer_data
D: 52428800.000 bits/s - U: 30836523.008 bits/s |dload=52428800.000bits/s uload=30836523.008bits/s
On the web output the command shows green, but I get a "Status Information: (No output returned from plugin)" output for the results.
The classic mistake is leaving out a needed argument, but I don't see that here.

It's Friday and maybe Monday some fresh eyes will help, but I'd like to collect some info this weekend.
Guidance would be appreciated.

Re: Bandwidth test and No output returned from plugin

Posted: Fri Mar 09, 2018 5:16 pm
by npolovenko
Hello, @rdubya. If a plugin produces a blank line before the output message Nagios will show "No output returned from plugin". That includes any errors that script might output before the actual message.
I think you allready ran the command locally as a sudo user and it looks like there were no errors or blank lines.

Code: Select all

[root@engmon objects]# /usr/local/nagios/libexec/check_speed.sh -H wal-nfsserver -s 5120  -d /home/engops/xfer_data -r /home/engops/xfer_data
D: 52428800.000 bits/s - U: 30836523.008 bits/s |dload=52428800.000bits/s uload=30836523.008bits/s
Now, lets try to run the plugin as if Nagios ran it. Switch to the Nagios user and run the plguin locally one more time:

Code: Select all

su - nagios
 /usr/local/nagios/libexec/check_speed.sh -H wal-nfsserver -s 5120  -d /home/engops/xfer_data -r /home/engops/xfer_data

Re: Bandwidth test and No output returned from plugin

Posted: Mon Mar 12, 2018 9:30 am
by rdubya
Thanks for your reply. So yeah, running under nagios was a non-starter and I ended up fixing that, but I still have the same situation. The script runs well as nagios user, but the "No output" message remains in the gui with no stats collected.

Code: Select all

[nagios@engmon ~]$ /usr/local/nagios/libexec/check_speed.sh -H wal-nfsserver -s 5120  -d /var/spool/nagios/xfer_data -r /var/spool/nagios/xfer_data
D: 22481469.440 bits/s - U: 39938162.688 bits/s |dload=22481469.440bits/s uload=39938162.688bits/s
Comparing to a command that works and graphs well, I wonder if the output text for check_speed somehow breaks things;

Code: Select all

[nagios@engmon ~]$ /usr/local/nagios/libexec/check_nrpe -H slave_04 -c check_buildartifacts
DISK OK - free space: /build/artifacts 516918 MB (25% inode=99%);| /build/artifacts=1547073MB;1651286;1857697;0;2064108

Re: Bandwidth test and No output returned from plugin

Posted: Mon Mar 12, 2018 3:30 pm
by kyang
I don't exactly remember, but I remember someone else was having issues using this plugin before as well.

Could never get it to display output onto the GUI.

Do you have the latest version of the plugin? Looks like it was updated in Dec 2017. (1.2)

https://github.com/jonwitts/nagios-spee ... est-cli.sh

Here is his new Nagios Exchange link.
https://exchange.nagios.org/directory/P ... li/details

Try that out and let us know! (You could also, post this as an issue for the author and see what he says since he created the plugin.)

Re: Bandwidth test and No output returned from plugin

Posted: Wed Mar 14, 2018 1:27 pm
by rdubya
Yes, I have the latest but rather than try to fix his I'll just write my own. Thanks for the help, if I get stuck I'll create another issue.

R

Re: Bandwidth test and No output returned from plugin

Posted: Wed Mar 14, 2018 2:13 pm
by kyang
Sounds good! I'll be closing this thread!

If you have any more questions, feel free to create another thread.

Thanks for using the Nagios Support Forum!