Hi, You will get duplication if you declare a nagioshost_group with the same name on more than one node... I think you may be missing the point of nagios_hostgroup. It is for declaring a hostgroup in nagios not setting the nagios hostgroup for a node.
I am guessing you are trying to add a node to a hostgroup? You will need to add a hostgroups parameter to your nagios_host declaration and set the hostgroup for the node there. I am also reasonably sure you can have empty hostgroups in nagios... if you want a kickstart there are a few monitoring modules on puppet forge. (I wrote some that may help) On 20 February 2013 11:27, Sans <r.santanu....@gmail.com> wrote: > Is there any way to create the Nagios hostgroup only when the first (or > at least one) member of that hostgroup comes on line? > > I tried with Puppet Storeconfigs: The client node exports the > nagios_hostgroup resource: > >> @@nagios_hostgroup { 'cloud-app': >> alias => "Application Servers",} >> >> > > and the server node collects it: > >> Nagios_hostgroup <<| |>> { notify => Service['nagios'] } >> >> > > It works for the first node but get "duplicate definition" error as soon > as the second node of that hostgroup comes online and try to export the > very same resource. > > Specifying hostgroup in the Nagios server manifest (and exporting the > nagios_host instead) initially solve this issue but the biggest problem > with this approach is: in a multi hostgroup configuration, Nagios won't > start until atleast one member from the each hostgroup comes on-line. This > leaves us with a huge inconvenience. As all the hostgroups are created > during the Nagios server configuration, Nagios refuses to start until the > first member of the last hostgroup is configured. For us, it takes up to 30 > mins. Is there any workaround/fix for this issue? Any pointer would be > greatly appreciated. Cheers!! > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to puppet-users+unsubscr...@googlegroups.com. > To post to this group, send email to puppet-users@googlegroups.com. > Visit this group at http://groups.google.com/group/puppet-users?hl=en. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.