Need help using check_by_ssh with check_disk
Dave
tdbtdb+nagios at gmail.com
Thu Nov 29 22:25:59 CET 2007
Oops, sent from wrong return address.
---------- Forwarded message ----------
From: Dave Burns <tburns at hawaii.edu>
Date: Nov 29, 2007 11:12 AM
Subject: Re: [Nagios-users] Need help using check_by_ssh with check_disk
To: nagios-users at lists.sourceforge.net
On Nov 29, 2007 6:09 AM, Sean Bowers <unix678 at gmail.com> wrote:
> >From the command line, both hosts work fine and 'echo $?' shows 0 for
> both.
In a similar situation, I found it helpful to break my command line
tests into steps. First ssh directly into the remote as nagios and
execute the disk check, as you seem to have done. Then
sudo -u nagios ssh -i /var/spool/nagios/.ssh/id_dsa nagios at remote
"/usr/lib/nagios/plugins/check_disk -w 10% -c 5% -e -m -p /"
to make sure the key is working and the args and path are correct. Then
sudo -u nagios /usr/lib/nagios/plugins/check_by_ssh -H linoleum -i
/var/spool/nagios/.ssh/id_dsa -C "/usr/lib/nagios/plugins/check_disk
-w 10% -c 5% -e -m -p /"
If that works, the regular nagios process should work. I once had a
sticky problem where I could get the above working, but nagios kept
telling me unknown. It turned out I had a subtle little typo in my
config that made it different from my command line tests. Headache!
HTH,
Dave
Here are my defs
define command{
command_name check_slash_free
command_line $USER1$/check_by_ssh -i
/var/spool/nagios/.ssh/id_dsa -H $HOSTADDRESS$ -C '$USER1$/check_disk
-w $ARG1$ -c $ARG2$ -e -p \/ -m '
}
and the service
define service {
host_name <hostname>
service_description check slash
check_command check_slash_free!30%!20%
max_check_attempts 3
retry_check_interval 1
normal_check_interval 5
check_period 24x7
notification_interval 120
notification_period 24x7
notification_options w,u,c,r,f
contact_groups localadmins
}
-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell. From the desktop to the data center, Linux is going
mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list