Page 1 of 1

by_ssh plugin issue

Posted: Wed Aug 25, 2021 10:37 am
by pizu
Hi,

Am trying to use the check_by_ssh using the below command:

./check_by_ssh -fqv -H remoteserver -C [ "sudo", "mysql -uusernamehere -ppasswordhere -s -e "use radius; select * from radacct WHERE acctstoptime IS NULL;" |wc -l" ]

and am getting the below:
-su: syntax error near unexpected token `from'

also when trying

./check_by_ssh -H remoteserver -p 22 -fqv -C [ "mysql -uusernamehere -ppasswordhere -s -e 'SELECT * FROM 'radius'.'radacct' WHERE acctstoptime IS NULL;' | wc -l" ]

am getting:

check_by_ssh: No remotecmd

the server where I am connecting is an ubuntu server.

as for the identity I have created a public key under /root/.ssh/id of the remote server

Can someone help? please

Thanks:)

Re: by_ssh plugin issue

Posted: Fri Aug 27, 2021 3:23 am
by pizu
issue solved by doing the count from mysql itsfel, but it would be great if we could use this as the reply I wanted in my case was just 1 number and not that the query is ok etc..

Re: by_ssh plugin issue

Posted: Thu Sep 02, 2021 9:56 am
by benjaminsmith
Hi pizu,

Sounds like you got it figured out, so we'll mark this as resolved.

If you looking for different output to Nagios, you might want to consider writing a simple plugin or wrapper script for this check.