Maxence Dunnewind
2012-Sep-04 07:44 UTC
[Puppet Users] Get a list of (some) resources name
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
Maxence Dunnewind
2012-Sep-10 06:31 UTC
Re: [Puppet Users] Get a list of (some) resources name / Manage your nagios hostgroups
Hi,> 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).nobody has an opinion on this, how do you manage your nagios hostgroups without setting them in a static/hardcoded way ? Maxence -- Maxence Dunnewind System Engineer on Bonfire Research Center INRIA Rennes - Bretagne Atlantique, France Team Myriads, Office E219, tel +33 2 99 84 25 76