Hi, I''m currently switching our local network over to puppet configuration, latest problem is how to manage nagios2. I try to follow David Schmitt''s nagios2 module but need some basic assistence. 1. What is this expression good for and where can I find some docs about it: # import the various definitions File <<||>> 2. Is it possible to do the following: node ''machine1'' { # monitored by nagios2: include nagios2::client } where nagios2::client means: class nagios2::client { include nrpe file { "/etc/nagios/nrpe_local.cfg": source => "puppet:///nagios/nrpe_local.cfg", owner => root, group => root, mode => 644, checksum => md5, notify => Service[nrpe], } } class nrpe { package { [nagios-nrpe-server, nagios-plugins]: ensure => installed } service { nrpe: ensure => running, pattern => "/usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -d", restart => "/etc/init.d/nagios-nrpe-server reload", } } So far it works but (how) can I trigger from the definition of machine1 the addition of a host entry on the nagios2 server? When I use the ''define host''-Definition, this is meant to work on the nagios2 server. Do I need the (redundant) entries: node ''nagios2server'' { .... nagios2::host{ "machine1": ip => "machine1" } nagios2::host{ "machine2": ip => "machine2" } nagios2::host{ "machineN": ip => "machineN" } } Or am I totally wrong? TIA Helmut -- ------------------------------------------------------------------------- Helmut Lichtenberg <Helmut.Lichtenberg@fli.bund.de> Tel.: 05034/871-128 Institut für Nutztiergenetik (FLI) 31535 Neustadt Germany ------------------------------------------------------------------------- --~--~---------~--~----~------------~-------~--~----~ 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-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Hi> 1. What is this expression good for and where can I find some docs about it: > > # import the various definitions > File <<||>>they import the exported resources (@@ stuff on clients) on the nagios server. more infos here: http://reductivelabs.com/trac/puppet/wiki/ExportedResources> 2. Is it possible to do the following: > > node ''machine1'' { > # monitored by nagios2: > include nagios2::client > } > > where nagios2::client means: > > class nagios2::client { > include nrpe > file { "/etc/nagios/nrpe_local.cfg": > source => "puppet:///nagios/nrpe_local.cfg", > owner => root, group => root, mode => 644, checksum => md5, > notify => Service[nrpe], > } > } > > class nrpe { > package { [nagios-nrpe-server, nagios-plugins]: ensure => installed } > service { nrpe: > ensure => running, > pattern => "/usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -d", > restart => "/etc/init.d/nagios-nrpe-server reload", > } > } > > So far it works but (how) can I trigger from the definition of machine1 the > addition of a host entry on the nagios2 server? > When I use the ''define host''-Definition, this is meant to work on the nagios2 > server. Do I need the (redundant) entries: > > node ''nagios2server'' { > .... > nagios2::host{ "machine1": ip => "machine1" } > nagios2::host{ "machine2": ip => "machine2" } > nagios2::host{ "machineN": ip => "machineN" } > } > > Or am I totally wrong?this is what exported resources are for. greets pete --~--~---------~--~----~------------~-------~--~----~ 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-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Peter Meier schrieb am 10. Jul 2008 um 14:51:13 CEST:> they import the exported resources (@@ stuff on clients) on the nagios > server. more infos here: > http://reductivelabs.com/trac/puppet/wiki/ExportedResourcesAh, that looks *quite* powerfull. What about ''Exporting Is Still Experimental''? Is it yet ready for production mode or will it break in the near future? Anyway, thanks a lot! Helmut --~--~---------~--~----~------------~-------~--~----~ 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-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Helmut Lichtenberg wrote:> What about ''Exporting Is Still Experimental''? Is it yet ready for production > mode or will it break in the near future?One gotcha that I have noticed is that it seems impossible to specify any requires before collecting the exported resources. In my experience, anyway. Using the nagios example, if puppet hasn''t installed the nagios Package and it tries to collect the resources, it will fail (assuming you didn''t manually create /etc/nagios before running puppetd). I haven''t found a resolution for this yet. :( -scott --~--~---------~--~----~------------~-------~--~----~ 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-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Scott Smith wrote:> One gotcha that I have noticed is that it seems impossible to specify > any requires before collecting the exported resources. In my experience, > anyway.I forgot to add- even if you specify a File resource for everything that gets collected in your exported Nagios resources, it still doesn''t work: $nagios_dir = "/etc/nagios" file { $nagios_dir: owner => root, group => root, mode => 0755, source => "puppet://$servername/nagios/empty", ensure => directory, recurse => true, purge => true, require => Package["nagios"], notify => Service["nagios"], alias => "nagios_cfg_dir" } file { [ "$nagios_dir/nagios_contact.cfg", "$nagios_dir/nagios_contactgroup.cfg", "$nagios_dir/nagios_command.cfg", "$nagios_dir/nagios_host.cfg", "$nagios_dir/nagios_service.cfg", "$nagios_dir/nagios_servicegroup.cfg", "$nagios_dir/nagios_timeperiod.cfg" ]: owner => root, group => root, mode => 0644, ensure => file, require => [ Package["nagios"], File["nagios_cfg_dir"] ], notify => Service["nagios"] } Yet in my syslog: Jul 10 10:23:08 host puppetd[8938]: Starting catalog run Jul 10 10:23:10 host puppetd[8938]: (//Node[host.domain.com]/nagios/Nagios::Command[host-notify-by-email]/Nagios_command[host-notify-by-email]/ensure) created Jul 10 10:23:10 host puppetd[8938]: Could not apply complete catalog: Puppet::Util::FileType::FileTypeFlat could not write /etc/nagios/nagios_command.cfg: No such file or directory - /etc/nagios/nagios_command.cfg Jul 10 10:23:10 host puppetd[8938]: Finished catalog run in 1.67 seconds -scott --~--~---------~--~----~------------~-------~--~----~ 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-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Scott Smith wrote:> I forgot to add- even if you specify a File resource for everything that > gets collected in your exported Nagios resources, it still doesn''t work:K, figured this one out just now. You have to have the require in the virtual resource itself. Makes sense now that I think about it. -scott --~--~---------~--~----~------------~-------~--~----~ 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-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---