Check_by_ssh not working

Hi Team,

check_by_ssh is not working getting below error
error :
Remote command execution failed: Authorized uses only. All activity may be monitored and reported.
command :
/usr/lib64/nagios/plugins/check_by_ssh -v -H 10.10.10.10 -l user-i id_rsa -C “/usr/lib64/nagios/plugins/check_users -w 0 -c 2”

ssh login password less is alrady set and login is working without password.

Please show us the command you are using, and tell us which machine you are
running it on, to show that “login is working without password”.

Regards,

Antony.

[icinga@10.10.10.20 ~]$ ssh icinga@10.10.10.10
Authorized uses only. All activity may be monitored and reported.
Last login: Tue Jun 2 14:11:10 2020 from 10.10.10.20
[icinga@10.10.10.10 ~]$

10.10.10.20 : icinga master source
10.10.10.10 : remote server client

[icinga@10.10.10.20 ~]$ ssh icinga@10.10.10.10
Authorized uses only. All activity may be monitored and reported.
Last login: Tue Jun 2 14:11:10 2020 from 10.10.10.20
[icinga@10.10.10.10 ~]$

So, you can connect to the client machine from the master as user “icinga” on
both. Good.

/usr/lib64/nagios/plugins/check_by_ssh -v -H 10.10.10.10 -l user-i id_rsa
-C “/usr/lib64/nagios/plugins/check_users -w 0 -c 2”

However that tells me that you’re connecting as user “user-i”, or (I strongly
suspect that lack of a space is a typo) you mean you’re conecting as user
“user” and providing the SSH key “id_rsa”.

Firstly that “user” should be “icinga” and secondly the SSH key parameter
should point to a fully-qualified path such as /home/icinga/…ssh/id_rsa

On the other hand the string “Remote command execution failed: Authorized uses
only. All activity may be monitored and reported.” is not an error message.
It’s simply the greeting banner you get when you successfully connect, so it’s
entirely possible that your problem is actually that you’re connecting by SSH
but then not running the command you wanted to.

What happens if you SSH to the machine as user icinga (as you demonstrate
above) and then run the command:

/usr/lib64/nagios/plugins/check_users -w 0 -c 2

?

Regards,

Antony.

1 Like

Hi,
Thank you very much for support.
I added -q parameter to supress the banner and it is working.
you can close the requst