Can’t set warning and critical thresholds on check_by_ssh
Posted: Tue Aug 11, 2020 3:35 pm
Greetings Gurus! 
I’m writing some check_by_ssh checks in Nagios Core 4.4.5 for service information that is only locally accessible on remote systems (not available through SNMP and I don’t want to install NRPE on the client system). I’ve finally gotten the knack of reporting back warning and critical status based on the information received. This command is confirmed to work and run AS the nagios user:
sudo -u nagios /lib64/nagios/plugins/check_by_ssh -H testserver -C "/home/testuser/proxysqlstatustest.sh" -l testuser -i /etc/nagios/private/testuser.key
But I also want to raise flags when the process takes too long. To that end, when I run check_by_ssh -h (version 2.3.3-2.el7) I see these 2 options:
-w, --warning=DOUBLE
Response time to result in warning status (seconds)
-c, --critical=DOUBLE
Response time to result in critical status (seconds)
But when add a -w 1 -c 2 to the already working and tested command I get:
sudo -u nagios /lib64/nagios/plugins/check_by_ssh -H testserver -C "/home/testuser/proxysqlstatustest.sh" -l testuser -i /etc/nagios/private/testuser.key -w 1 -c 2
/lib64/nagios/plugins/check_by_ssh: invalid option -- 'w'
Usage:
check_by_ssh -H <host> -C <command> [-fqv] [-1|-2] [-4|-6]
[-S [lines]] [-E [lines]] [-t timeout] [-i identity]
[-l user] [-n name] [-s servicelist] [-O outputfile]
[-p port] [-o ssh-option] [-F configfile]
So, is this a bug or am I doing something wrong? I thought maybe it was something that only works when run in the Nagios environment, but my response when I add the parameters to the working command object is the same usage message I get when running it at the prompt.
Any suggestions would be appreciated.
Thanks,
Scott
I’m writing some check_by_ssh checks in Nagios Core 4.4.5 for service information that is only locally accessible on remote systems (not available through SNMP and I don’t want to install NRPE on the client system). I’ve finally gotten the knack of reporting back warning and critical status based on the information received. This command is confirmed to work and run AS the nagios user:
sudo -u nagios /lib64/nagios/plugins/check_by_ssh -H testserver -C "/home/testuser/proxysqlstatustest.sh" -l testuser -i /etc/nagios/private/testuser.key
But I also want to raise flags when the process takes too long. To that end, when I run check_by_ssh -h (version 2.3.3-2.el7) I see these 2 options:
-w, --warning=DOUBLE
Response time to result in warning status (seconds)
-c, --critical=DOUBLE
Response time to result in critical status (seconds)
But when add a -w 1 -c 2 to the already working and tested command I get:
sudo -u nagios /lib64/nagios/plugins/check_by_ssh -H testserver -C "/home/testuser/proxysqlstatustest.sh" -l testuser -i /etc/nagios/private/testuser.key -w 1 -c 2
/lib64/nagios/plugins/check_by_ssh: invalid option -- 'w'
Usage:
check_by_ssh -H <host> -C <command> [-fqv] [-1|-2] [-4|-6]
[-S [lines]] [-E [lines]] [-t timeout] [-i identity]
[-l user] [-n name] [-s servicelist] [-O outputfile]
[-p port] [-o ssh-option] [-F configfile]
So, is this a bug or am I doing something wrong? I thought maybe it was something that only works when run in the Nagios environment, but my response when I add the parameters to the working command object is the same usage message I get when running it at the prompt.
Any suggestions would be appreciated.
Thanks,
Scott