check_period serivces using variables

Marc Torres sarinyo at gmail.com
Thu Jul 31 15:40:29 CEST 2008


Hi all,

I'm quite new to nagios and I would like to be able to configure the
service check_period, to be the same as the host witch this service
belongs to. I mean I've got 3 type of hosts, and I've defined the
services for this 3 types of hosts.  It can be thousands (even few
hundreds) hosts for one host type, and I want to be able to change one
hosts check_period and then ALL the servcies for that hosts get its
check_period changed accordingly, but without to write explicity them.
Is this possible?

Heres a little scenario of what I'm trying:

# template for host type 1
define host
{
    name type1-template
    check_period default
   [...]
   register 0
}

#host1
define host
{
  host_name    host1
  [...]
  hostgroups     type1
  use type1-template
}

define host
{
  host_name host2
  [...]
  hostgroups  type1
  use type1-template
}

#template for services of type1 hosts
define service
{
   name type1-service-template
   hostgroup_name type1
   check_period  default
   [...]
   register 0
}

#service for type1 hosts
define service
{
  service_description service1
  [...]
}

What i would like is that when I change the check_period for the host1
(rewriting its template value), the check_period of all services
related to this hosts, get its check_timeperiod changed accordingly
without affecting the rest of the hosts.

I'm absolutely lost here, the only thing that comes to my mind is to
rewrite heach service and set the ckeck_timeperiod accordingly, but I
don't like this way.

Cheers,

Marc.

-- 
"I'm unique, just like everyone else". Read it out there

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
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