Hi,

I'm moving our monitoring configuration from custom-script to puppet.
One of my main issue is that I have some nagios groups with many host on them.
For exemple, a group for all host which have a munin-node running, a group for
the others, etc ...
So, my goal is to be able to make a nagios_host belong to a list of group in a
non-static way (the list of groups is generated from the different puppet
classes run on each node).
The first thing I thought of was to use a list, for exemple :
@@nagios_host { "foo":
 [...]
 hostgroups => [ "group1", "group2" ]
}

So that I could easily extend it with something like :
Nagios_host["foo"] {
    hostgroups +> ["group3"]
}

But, afaik, puppet does not yet support this (reported as bug #4020) (We use
puppet 2.6.9).

So, my second approach is to use tags and nagios_hostgroups, for exemple :
nagios_host { "foo":
  [...]
  tag => ["X","Y"]
}
nagios_host { "bar":
  [...]
  tag => ["Y", "Z"]
}

nagios_hostgroup { "Y":
  [...]
  members => somemagicfunction("Y")
}

Here, the "somemagicfunction" should be able to find all the list of Nagios_host
resources with the tag "Y", and return a list of their title, so something like
"foo,bar".

Any way to do this ? Or is their any better solution/workaround ? 

Regards,

Maxence

-- 
Maxence Dunnewind

Attachment: signature.asc
Description: Digital signature

Reply via email to