One service definition for all hosts

Thomas Guyot-Sionnest dermoth at aei.ca
Fri May 25 14:00:12 CEST 2007


On 25/05/07 06:11 AM, Patryk Lasoń wrote:
> On pią, maj 25, 2007 at 10:18:35 +0100, Simon Beale wrote:
>> Under the service definition change hostgroup to hostgroup_name.
>>
>> Note a service can have both a host_name list and a hostgroup_name list,
>> and the check will be run for both lists.
> 
> Thanks a lot!

What can also help is using "hostgroups" in host definitions instead of
maintaining a list of hosts in the hostgroup definition. Together with
templates you could get something like:

define host
 name       wns_host
 hostgroups wns
 use        default_host
 register   0
}

define hostgroup{
 hostgroup  wns
 alias      WNS Cluster
}

#for each wns server:
define host{
 host_name wnsXXX
 alias     blah
 address   1.2.3.4
 use       wns_host
}

define service{
 hostgroup_name      wns
 service_description SSH
 check_command       check_ssh
 use                 default_service
}

This is assuming that default_host and default_service are templates
with all your defauklt configuration parameters. "register 0" tells
Nagios that this is not an actual definition, but you can use it in
other definition with "use TEMPLATE_NAME"

Thomas

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/




More information about the Developers mailing list