Hi, > i want to archive the following: > > i define an exported ressource for HostX to be monitored in nagios: > > @@nagios_host { $fqdn: > ensure => present, > alias => $hostname, > address => $ipadress, > use => "generic-host", > hostgroups => ubuntu, > target => $icingahostfile, > } > > That fine and works as expected and HostX is in hostgroup ubuntu. > HostX has included a class ssh which installs the ssh services and > configures them. Inside this class i want to define that HostX is also in > hostgroup ssh-server. > And another class, which puts the node in another environment => there i > want to define, that HostX is in hostgroup testing-server and so on. > How do i archive that? How must the definition inside all these classes > look like?
That's a lot more difficult than you might expect. I recently solved it, by collecting all the necessary hostgroups for a host in a file using 'concat', and creating a custom fact (hostgroups) that joins all the lines in the hostgroups-file together, for use with nagios_host's hostgroups parameter. The biggest drawback is that it takes two puppet runs on the target (first one for populating the hostgroups-file, so that the custom fact is set properly on the second run) before the nagios server can collect the exported hosts, so it takes a while. Best regards, Martijn. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.