Page 1 of 1

MOTD breaks check_by_ssh?

Posted: Wed Mar 27, 2019 9:01 am
by jenstar13
Hi,
our security department installed a motd on one of their servers yesterday and it broke the check_by_ssh load check
is there a way to suppress the modt in the check_by_ssh command?
I tried the -S and that failed
I tried the .hushlogin on the server, and that failed (I've contacted other teams to see why RH7 does not like that)
is there any flag that i can use

Here is what the error looks like in verbose command line mode, and i can't figure out how to make it give more more info
[nagios@~]$ /usr/local/nagios/libexec/check_by_ssh -vv -H 10.xx.xxx.22 -C "/usr/lib/nagios/plugins/check_load -q -r -w 30,30,30 -c 50,50,50"
Command: /bin/ssh
Argument 1: 10.xx.xxx.22
Argument 2: /usr/lib/nagios/plugins/check_load -q -r -w 30,30,30 -c 50,50,50
Remote command execution failed:

however, if i log onto the box and run the command as nagios it works just fine

[nagios@~]$ ssh xxxprdxxx01.xxxx.net
UNAUTHORIZED ACCESS TO THIS DEVICE IS PROHIBITED

You must have explicit, authorized permission to access or configure this
device. Unauthorized attempts and actions to access or use this system may
result in civil and/or criminal penalties. All activities performed on this
device are logged and monitored.
[nagios@~]$ /usr/lib/nagios/plugins/check_load -r -w 30,30,30 -c 50,50,50
OK - load average: 0.01, 0.01, 0.01|load1=0.005;30.000;50.000;0; load5=0.005;30.000;50.000;0; load15=0.006;30.000;50.000;0;

any ideas?
thank you in advance
Jennifer

Re: MOTD breaks check_by_ssh?

Posted: Wed Mar 27, 2019 9:12 am
by scottwilkerson
I believe you added the -q to the wrong location

Try

Code: Select all

/usr/local/nagios/libexec/check_by_ssh -q -vv -H 10.xx.xxx.22 -C "/usr/lib/nagios/plugins/check_load -r -w 30,30,30 -c 50,50,50"

Re: MOTD breaks check_by_ssh?

Posted: Wed Mar 27, 2019 9:17 am
by jenstar13
hi Scott, thank you!!!
it worked perfectly, this can be closed

[nagios@~]$ /usr/local/nagios/libexec/check_by_ssh -q -vv -H 10.xx.xxx.22 -C "/usr/lib/nagios/plugins/check_load -r -w 30,30,30 -c 50,50,50"
Command: /bin/ssh
Argument 1: -q
Argument 2: 10.xx.xxx.22
Argument 3: /usr/lib/nagios/plugins/check_load -r -w 30,30,30 -c 50,50,50
OK - load average: 0.00, 0.00, 0.01|load1=0.000;30.000;50.000;0; load5=0.001;30.000;50.000;0; load15=0.006;30.000;50.000;0;

Re: MOTD breaks check_by_ssh?

Posted: Wed Mar 27, 2019 9:24 am
by scottwilkerson
jenstar13 wrote:hi Scott, thank you!!!
it worked perfectly, this can be closed

[nagios@~]$ /usr/local/nagios/libexec/check_by_ssh -q -vv -H 10.xx.xxx.22 -C "/usr/lib/nagios/plugins/check_load -r -w 30,30,30 -c 50,50,50"
Command: /bin/ssh
Argument 1: -q
Argument 2: 10.xx.xxx.22
Argument 3: /usr/lib/nagios/plugins/check_load -r -w 30,30,30 -c 50,50,50
OK - load average: 0.00, 0.00, 0.01|load1=0.000;30.000;50.000;0; load5=0.001;30.000;50.000;0; load15=0.006;30.000;50.000;0;
Great!

Locking thread