[Nagiosplug-help] problem with check_oracle_health via check_by_ssh

Litwin, Matthew mlitwin at stubhub.com
Tue Feb 9 02:04:22 CET 2010


Hi there,

I am attempting set up a nagios command that will use the check_oracle_heath plugin to excute some SQL. I have figured out how to send the command over ssh using the encoding switch in check_oracle_health but for some reason when I use the exact same command in command.cfg it fails.

Here is the command I run over ssh which runs correctly:
$ /usr/bin/ssh -l nagios 10.80.00.00 '/usr/local/nagios/libexec/check_oracle_health --connect STSPDB --user usermon --password password --encode --mode sql --name="select%20decode%28status%2C%27ENABLED%27%2C0%2C1%29%20from%20DBA_CAPTURE%20where%20queue_name%3D%27STREAMS_CAPTURE_Q_STU5%27" --name2="status" --warn .1 --critical .2'
OK - status: 0 | 'status'=0;.1;.2


Here is the command definition:
define command{
        command_name    check_oracle_streams_by_ssh        command_line    $USER1$/check_by_ssh -H $HOSTADDRESS$ -t 60 -l nagios -C '$USER1$/check_oracle_health --connect $ARG1$ --user $USER21$ --password $USER22$ --encode --mode sql --name="select%20decode%28status%2C%27ENABLED%27%2C0%2C1%29%20from%20$ARG2$%20where%20queue_name%3D%27$ARG3$%27" --name2="status" --warn .1 --critical .2
'
        }

Here is what nagios puts out in its status when it reports UNKNOWN:
Could not open pipe: /usr/bin/ssh -l nagios 10.80.00.00 '/usr/local/nagios/libexec/check_oracle_health --connect STSPDB --user usermon --password password --encode --mode sql --name="select%20decode%28status%2C%27ENABLED%27%2C0%2C1%29%20from%20DBA_CAPTURE%20where%20queue_name%3D%27STREAMS_CAPTURE_Q_STU5%27" --name2="status" --warn .1 --critical .2'

What is so flummoxing is that the status output is exactly what I expect it to be and what works when I invoke via ssh so this doesn't make a lot of sense to me. Any suggestions as to why using check_by_ssh is throwing the "Could not open pipe" error when running the same thing verbatim over ssh works fine? My first guess is the single and double quotes being munged somewhere between nagios and ssh, but the command it is trying to invoke looks right.


Thanks,
Matthew Litwin
mlitwin at stubhub.com<mailto:mlitwin at stubhub.com>
415.222.8475





More information about the Help mailing list