by_ssh plugin issue

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
pizu
Posts: 2
Joined: Wed Aug 25, 2021 10:30 am

by_ssh plugin issue

Post 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:)
pizu
Posts: 2
Joined: Wed Aug 25, 2021 10:30 am

Re: by_ssh plugin issue

Post 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..
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: by_ssh plugin issue

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked