Re: [Puppet Users] Puppet managed hosts in multiple nagios hostgroups

2011-06-10 Thread Martijn Grendelman
On 08-06-11 16:29, Chris Phillips wrote: > updated, and hopefully finished: > > Facter.add(:bp_nagios_hostgroups) do > setcode do > > if FileTest.exists?("/var/lib/puppet/classes.txt") > bp_nagios_hostgroups = "" > File.open("/var/lib/puppet/classes.txt") { |fi

Re: [Puppet Users] Puppet managed hosts in multiple nagios hostgroups

2011-06-08 Thread Chris Phillips
updated, and hopefully finished: Facter.add(:bp_nagios_hostgroups) do setcode do if FileTest.exists?("/var/lib/puppet/classes.txt") bp_nagios_hostgroups = "" File.open("/var/lib/puppet/classes.txt") { |file| file.each { |line|

Re: [Puppet Users] Puppet managed hosts in multiple nagios hostgroups

2011-06-08 Thread Chris Phillips
Actually, I think I see what you mean here, I have a custom fact mid write which looks like this: Facter.add(:nagios_hostgroups) do setcode do if FileTest.exists?("/var/lib/puppet/classes.txt") nagios_hostgroups = "" File.open("/var/lib/puppet/classes.txt") { |

Re: [Puppet Users] Puppet managed hosts in multiple nagios hostgroups

2011-06-08 Thread Chris Phillips
Some more specifics on *exactly* how you manage this text file would be appreciated. On 8 June 2011 15:00, Brian Gallew wrote: > I solved this in a similar manner. I wrote a custom fact (which > essentially returned /var/lib/puppet/state/classes.txt) and then a custom > function that generated

Re: [Puppet Users] Puppet managed hosts in multiple nagios hostgroups

2011-06-08 Thread Brian Gallew
I solved this in a similar manner. I wrote a custom fact (which essentially returned /var/lib/puppet/state/classes.txt) and then a custom function that generated a list of hostgroups based on that. On Wed, Jun 8, 2011 at 6:47 AM, Chris Phillips wrote: > > > On 8 June 2011 13:30, Martijn Grendel

Re: [Puppet Users] Puppet managed hosts in multiple nagios hostgroups

2011-06-08 Thread Chris Phillips
On 8 June 2011 13:30, Martijn Grendelman wrote: > 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, >

Re: [Puppet Users] Puppet managed hosts in multiple nagios hostgroups

2011-06-08 Thread Martijn Grendelman
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

[Puppet Users] Puppet managed hosts in multiple nagios hostgroups

2011-06-08 Thread elderdakkar
Hello 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=> "generi