[Nagiosplug-help] check_by_ssh question

Robert Cole robert.cole at support4linux.com
Sat Jun 23 00:13:32 CEST 2007


Found my problem with the missing $ on the in of $ARG3$ but now it seems 
to match on just the word "No"

Here is a current config:

define service{
        use                             minor-service
        hostgroup_name                  tuis
        service_description             Oracle Database Connection Check
        check_command                   
check_ssh_log!/var/log/youmail/login.log!/home/nagios/$HOSTADDRESS$.var.log.login.server.seek!"No 
ManagedConnections available within configured blocking timeout"
        max_check_attempts              1
        notification_options            c
        }

define command{
        command_name    check_ssh_log
        command_line    $USER1$/check_by_ssh -H $HOSTADDRESS$ -i 
/home/nagios/.ssh/id_dsa -C "$USER9$/check_log -F $ARG1$ -O $ARG2$ -q 
\$ARG3$\"
        }

When I put the \ escape in like this I get this result:

Could not open pipe: /usr/bin/ssh -i /home/nagios/.ssh/id_dsa 
192.168.200.150 '/usr/nagios/plugins/check_log -F 
/var/log/youmail/login.log -O 
/home/nagios/192.168.200.150.var.log.login.server.seek -q "No 
ManagedConnections available within configured blocking timeout"'

When I take the \ escape out I get a match on every instance of "No".

Any ideas? And thank you so much for your help!

Olivier 'Babar' Raginel wrote:
> On Fri, Jun 22, 2007 at 01:50:32PM -0700, Robert Cole wrote:
>   
>> nagios at ms1 ~ $ ssh  tui001 -i ~/.ssh/id_dsa -C 
>> "/usr/nagios/plugins/check_log -F /var/log/youmail/login.log -O 
>> /home/nagios/192.168.200.150.var.log.login.server.seek -q "No 
>> ManagedConnections available within configured blocking timeout""
>> Unknown argument: ManagedConnections
>> Usage: check_log -F logfile -O oldlog -q query
>> Usage: check_log --help
>> Usage: check_log --version
>> Any ideas?
>>     
>
> Command interpretation.
> Your command is enclosd within "" so you have to escape them within the 
> ssh:
> $ ssh  tui001 -i ~/.ssh/id_dsa -C 
> "/usr/nagios/plugins/check_log -F /var/log/youmail/login.log -O 
> /home/nagios/192.168.200.150.var.log.login.server.seek -q \"No 
> ManagedConnections available within configured blocking timeout\""
>
> Or use simple quotes around the -C for ssh.
>
>   




More information about the Help mailing list