by_ssh plugin issue

Engage with the community of users including those using the open source solutions.
Includes Nagios Core, Plugins, and NCPA

by_ssh plugin issue

Postby pizu » Wed Aug 25, 2021 10:37 am


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

Posts: 2
Joined: Wed Aug 25, 2021 10:30 am

Re: by_ssh plugin issue

Postby pizu » Fri Aug 27, 2021 3:23 am

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

Re: by_ssh plugin issue

Postby benjaminsmith » Thu Sep 02, 2021 9:56 am

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!
User avatar
Posts: 5083
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Return to Community Support

Who is online

Users browsing this forum: Majestic-12 [Bot] and 24 guests