Command runs fine manually but not in nagios

Tedman Eng teng at dataway.com
Tue Aug 3 08:00:38 CEST 2004


Make sure you're using _ONLY_ $HOSTADDRESS$ in the check-host-alive-ssh
command that you have defined.  I once had this problem too until I looked
REALLY REALLY closely at the docs and found that "HOST CHECKS" supports VERY
limited set of nagios variables.  Notably, it doesn't support $ARG$
variables! (Argh!)

(see "Host Checks" column)
http://nagios.sourceforge.net/docs/1_0/macros.html

So you can't do something like this: 
check_host_ssh!username!identity!execcommand

My suggestion is to use check_tcp hard coded to port 22 in the command
instead:
define command {
	command_name	host-check-alive-tcp22 
	command_line	$USER1$/check_tcp -H $HOSTADDRESS$ -p 22
	}

Host checks need to happen fast, a full SSH session check is comparitively
slow...when really, only testing the port should suffice in most cases to
determine the same thing as ping would (ie. reachability)  If you'd like to
monitor ssh, define a check_ssh service check for that host, but for optimal
performance use fast checks like check_tcp, check_ping or check_udp for
host-check definitions.

-Tedman

-----Original Message-----
From: John Herdy [mailto:johnherdy at hotmail.com]
Sent: Monday, August 02, 2004 9:17 AM
To: nagios-users at lists.sourceforge.net
Subject: [Nagios-users] Command runs fine manually but not in nagios


I have searched this list but wasn't able to find anything.

When I run the following command as the nagios user;
/usr/nagios/libexec/check_by_ssh -t 120 -l root -i /etc/nagios/.ssh/id_dsa 
-H 130.177.194.149 -C '/usr/nagios/libexec/check_ssh 204.104.28.182'

I get the following result;
SSH OK - OpenSSH_3.8.1p1 (protocol 2.0)

Perfect, excactly how I want it.

I monitor everthing over ssh and therefor I have changed my "Host Check 
Command" to check for an active ssh-conncection, because ping is disabled in

our network setup.

If I define the command above as a "Host Check Command" I always get a "Host

Down-alert", with the following notification;
No Information Returned From Host Check

But in a console this runs fine?!?

I have double triple and quadrubble checked my configfiles 
(checkcommands.cfg and hosts.cfg) and I'm positive that they are ok.

I'm running Nagios 1.2

I have no idea how to debug this, because everything works fine on the 
command line. I'm using a dozen hosts with each a dozen services and had no 
problems before. If more information is required please let me know and I 
will provide.

Is anyone able to help me. Please !!!

Thanks a lot!
John.

_________________________________________________________________
MSN Search, for accurate results! http://search.msn.nl



-------------------------------------------------------
This SF.Net email is sponsored by OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com
_______________________________________________
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


-------------------------------------------------------
This SF.Net email is sponsored by OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com
_______________________________________________
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