[Nagios-users] Need help using check_by_ssh with check_disk

2007-11-29 Thread Sean Bowers
I'm running Nagios 2.10 with plugins 1.4.10 running on:
Linux nagioshost 2.6.9-34.ELsmp #1 SMP Fri Feb 24 16:56:28 EST 2006
x86_64 x86_64 x86_64 GNU/Linux

System information on the two remote hosts is:

Linux remotehost1 2.6.9-11.ELsmp #1 SMP Fri May 20 18:26:27 EDT 2005
i686 i686 i386 GNU/Linux
Linux remotehost2 2.6.9-5.ELsmp #1 SMP Wed Jan 5 19:30:39 EST 2005
i686 i686 i386 GNU/Linux


My check (in commands.cfg as check_disk_by_ssh) is:

$USER1$/libexec/check_by_ssh -E -i identify.txt -l nagios -H
$HOSTADDRESS$ -C /usr/lib/nagios/plugins/check_disk -w $ARG1$ -c
$ARG2$

The services.cmd has:

check_disk_by_ssh!10%!5%

This test runs fine on remotehost1, but on remotehost2 it returns back
UNKNOWN - check_by_ssh: Remote command
'/usr/lib/nagios/plugins/check_disk -w 10% -c 5%' returned status
255.  At first, I thought this could be a 32 vs. 64-bit issue, but
the Nagios host is 64-bit while both remotes are 32.

From the command line, both hosts work fine and 'echo $?' shows 0 for
both.  Logging into the remote boxes and running check_disk manually
is fine as well.  Using -v doesn't help since it doesn't show tracing
information.

Does anyone have any ideas or thoughts on this?  Are there any other
tricks I can try for debugging this?  Any help would be appreciated
immensely.

Thanks!

-
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@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


[Nagios-users] Need help using check_by_ssh with check_disk

2007-11-29 Thread Dave
Oops, sent from wrong return address.

-- Forwarded message --
From: Dave Burns [EMAIL PROTECTED]
Date: Nov 29, 2007 11:12 AM
Subject: Re: [Nagios-users] Need help using check_by_ssh with check_disk
To: nagios-users@lists.sourceforge.net


On Nov 29, 2007 6:09 AM, Sean Bowers [EMAIL PROTECTED] 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  [EMAIL PROTECTED]
/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_namecheck_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_interval1
normal_check_interval   5
check_period24x7
notification_interval   120
notification_period 24x7
notification_optionsw,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@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