Check cluster

Marc Powell marc at ena.com
Tue Mar 27 18:59:55 CEST 2007



> -----Original Message-----
> From: nagios-users-bounces at lists.sourceforge.net [mailto:nagios-users-
> bounces at lists.sourceforge.net] On Behalf Of Peter van den Berg
> Sent: Tuesday, March 27, 2007 10:43 AM
> To: nagios-users at lists.sourceforge.net
> Subject: [Nagios-users] Check cluster
> 
> Hi
> 
> After some time with Google, I've found several posts with sort of the
> same question, but no useable answers :-(
> 
> I've got problems getting the check_cluster2 plugin to work.
> I've got nagios v2.6 with plugins v1.4.6
> 
> The check definition is:
>  define command{
>         command_name    check_service_cluster
>         command_line    $USER1$/check_cluster2 -s -l $ARG1$ -w $ARG2$
-c
> $ARG3$ -d $arg4$
> }
> 
> The service definition is:
> define service{
> 	...
> 	check_command	check_service_cluster!"DNS
>
Cluster"!1!2!$SERVICESTATEID:host1:Service$,$SERVICESTATEID:host2:Servic
> e$,etc
> 	...
> 	}
> 
> The problem is as follows, no matter how many of the services are
> critical, the check keeps reporting everything ok.
> 
> When I run it from the commandline, I also get everything ok. When I
> replace the $SERVICESTATEID:host1:service$ with eg. 1,0,0,2  It
reports
> correctly 1 warning, 1 critical, 2 ok. So the error lies in the
> definition of the host/service state.
> 
> According to the documentation this should be:
> $SERVICESTATEID:<host>:<service>$
> 
> Any suggestions what's going wrong?

The problem would appear to be with the on-demand macro you're using in
your check_command. I don't use check_cluster2 but a quick glance at the
documentation for it and on-demand macros leads me to believe that you
are using an incorrect form of the on-demand macro in the check_command.
If the service check_command above is accurate, is the
service_description for the service you're trying to check on all
machines really named 'Service'? Same for host_name. Are they really
host1 and host2. I can't imagine any reason that you would need to
obfuscate those and it's possibly confusing. I might help if you post a
host, service and service description as unedited as possible.

It might also help you to diagnose what nagios is really doing by seeing
what nagios would be running.

define command{
        command_name    check_service_cluster
        command_line    echo '$USER1$/check_cluster2 -s -l $ARG1$ -w
$ARG2$ -c $ARG3$ -d $arg4$'
}

After a check attempt you'll see the full command as nagios would have
run it on the command line in the GUI.

--
Marc

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
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