I wanted to update this problem as it appears to have never been resolved. The current version of check_by_ssh still returns an "UKNOWN" status in nagios. I have ran the command manually from the command line and echoed $?, and while it does return 0, nagios is putting in an UNKNOWN status. Not only that but the status appears to be flapping.
<br><br>The Critical and Warning status appear to work every time, but when an OK status is returned from one of the check programs (check_load, check_disk, check_process), check_by_ssh returns an UNKNOWN almost 80% of the time.
<br><br>I've followed up with three different people on this list who have reported the problem, and all of them just decided to move to NRPE.<br><br>Has anyone gotten this plugin to work? I am assuming this is a code problem with check_by_ssh
<br><br><br><br><div><span class="gmail_quote">On 12/22/05, <b class="gmail_sendername">Demetri Mouratis</b> <<a href="mailto:dmourati@cm.math.uiuc.edu">dmourati@cm.math.uiuc.edu</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Thu, 22 Dec 2005, <a href="mailto:Mark.Law@thomson.com">Mark.Law@thomson.com</a> wrote:<br><br>> I tested the following command from the command line ~<br>><br>> /usr/bin/ssh -l nagios host1 chkAdminServer.pl<br>
><br>> and it returns OK with an exit code of 0.  Great.<br>><br>> When I put it into the following service definition, I get a Status<br>> UNKNOWN with STATUS INFORMATION (No Output)<br>><br>> define service{
<br>>  name                            check_adminserver<br>>  service_description             AdminServer<br>>  use                             hg.prod.check_5min<br>>  host                            host1,host2
<br>>  contact_groups                  systemgrp<br>>  check_command<br>> check_command_ssh!/path/to/perl/script/bin/chkAdminServer.pl!<br>> }<br>><br>> The check command definition is really simple also ~
<br>><br>> define command{<br>>  command_name    check_command_ssh<br>>  command_line    /usr/bin/ssh -l nagios $HOSTADDRESS$ $ARG1$<br>> }<br>If you are trying to ssh to another server and kick off the command there
<br>use check_by_ssh as follows:<br><br># check-remote-load<br>define command{<br>         command_name    check-remote-load<br>         command_line    $USER1$/check_by_ssh -H $HOSTADDRESS$ -C "$USER1$/check_load -w $ARG1$ -c $ARG2$"
<br>         }<br><br>In your example, put the chkAdminServer.pl scripts in the nagios plugins<br>directory on the target, e.g. /usr/lib/nagios/plugins then set the $USER1$<br>variable to the same.  Then, su - nagios of your nagios box and ssh target
<br>/usr/lib/nagios/plugins/chkAdminServer.pl.<br><br><br>-------------------------------------------------------<br>This SF.net email is sponsored by: Splunk Inc. Do you grep through log files<br>for problems?  Stop!  Download the new AJAX search engine that makes
<br>searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!<br><a href="http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click">http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click</a><br>
_______________________________________________<br>Nagios-users mailing list<br><a href="mailto:Nagios-users@lists.sourceforge.net">Nagios-users@lists.sourceforge.net</a><br><a href="https://lists.sourceforge.net/lists/listinfo/nagios-users">
https://lists.sourceforge.net/lists/listinfo/nagios-users</a><br>::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.<br>::: Messages without supporting info will risk being sent to /dev/null
<br></blockquote></div><br>