Greg Haase
2010-Sep-30 22:04 UTC
[Puppet Users] Nagios Module and use of the @@ and <<||>> notation
Greetings, I am working on getting Nagios implemented with Puppet so that when I add a node to Puppet a Nagios configuration file is generated. I can get nagios installed and configured on the server and the client with no problems. Yet getting the client configuration file on to the server is not happening. I did have it working at one point in time yet It seems that I cannot get back to that configuration. I am relying on notation using the @@ and <<||>> I found somewhere in the documentation yet I did not find a proper discussion of exactly how it works. I don''t feel that I have a proper understanding of how it works. What I understand is that by using the @@name {} I can load data into a "global object" that is accessible from any puppet member. Who uses the name <<||>> Notation to call the data stored in that global object. I believe that in the past I was able to view this information on my puppet server with ralsh nagios_host It would give me a listing of what was stored in nagios_host. Now when I do this I see nothing. Here is a listing of what I understand as being a way to use this: Is this correct? ----------------- class nagios-server{ ........ A bunch of other stuff .......... file { "/etc/nagios/": ensure => ''directory'', mode => 755, owner => nagios, group => nagios, recurse => true; } Nagios_host <<|target == "/etc/nagios/nagios_hosts.${fqdn}.cfg"|>> } ----------------- class nagios-client { @@nagios_host { $fqdn: target => "/etc/nagios/nagios_hosts.${fqdn}.cfg", ensure => present, alias => $hostname, address => $ipaddress, use => "my-servers", check_command => "check-host-alive", max_check_attempts => 3, hostgroups => "my-servers", contact_groups => "admins", } ........ A bunch of other stuff .......... } ----------------- Could someone please point me in the right direction to some documentation that could help clarify this the use of the @@ and <<||>>? I''d greatly appreciate it. Thanks Greg Greg Haase ghaase@syntheticgenomics.com -- 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.
Steven Wagner
2010-Sep-30 22:31 UTC
Re: [Puppet Users] Nagios Module and use of the @@ and <<||>> notation
Hi Greg, I''m on my phone at the moment so I don''t have the exact link handy, but there is a module on GitHub that works. I tinkered with it a lot in my old setup but found most of my problems were due to not really understanding how the collect/export functionality worked. This is my favorite feature of Puppet. When I got it working, I teared up a bit. :) I believe it''s http://github.com/DavidS/puppet-nagios (mobile edition) On Sep 30, 2010, at 3:04 PM, Greg Haase <ghaase@syntheticgenomics.com> wrote:> Greetings, > > I am working on getting Nagios implemented with Puppet so that when I add a > node to Puppet a Nagios configuration file is generated. > > I can get nagios installed and configured on the server and the client with > no problems. Yet getting the client configuration file on to the server is > not happening. I did have it working at one point in time yet It seems that > I cannot get back to that configuration. > > I am relying on notation using the @@ and <<||>> I found somewhere in the > documentation yet I did not find a proper discussion of exactly how it > works. I don''t feel that I have a proper understanding of how it works. > > What I understand is that by using the > > @@name {} > > I can load data into a "global object" that is accessible from any puppet > member. Who uses the > > name <<||>> > > Notation to call the data stored in that global object. > > I believe that in the past I was able to view this information on my puppet > server with > > ralsh nagios_host > > It would give me a listing of what was stored in nagios_host. Now when I do > this I see nothing. > > Here is a listing of what I understand as being a way to use this: > > Is this correct? > > > ----------------- > class nagios-server{ > ........ A bunch of other stuff .......... > file { "/etc/nagios/": > ensure => ''directory'', > mode => 755, > owner => nagios, > group => nagios, > recurse => true; > } > Nagios_host <<|target == "/etc/nagios/nagios_hosts.${fqdn}.cfg"|>> > } > ----------------- > class nagios-client { > @@nagios_host { $fqdn: > target => "/etc/nagios/nagios_hosts.${fqdn}.cfg", > ensure => present, > alias => $hostname, > address => $ipaddress, > use => "my-servers", > check_command => "check-host-alive", > max_check_attempts => 3, > hostgroups => "my-servers", > contact_groups => "admins", > } > ........ A bunch of other stuff .......... > } > ----------------- > > Could someone please point me in the right direction to some documentation > that could help clarify this the use of the @@ and <<||>>? > > > I''d greatly appreciate it. > > Thanks > > Greg > Greg Haase > ghaase@syntheticgenomics.com > > -- > 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. >-- 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.
Greg Haase
2010-Sep-30 22:46 UTC
Re: [Puppet Users] Nagios Module and use of the @@ and <<||>> notation
Stephen, Ah the David Schmitt nagios module. This is what I based my work on. I used it as a model. Are you aware of any documentation that clearly explains how this collect/export functionality works? Greg On 9/30/10 3:31 PM, "Steven Wagner" <leftathome@gmail.com> wrote:> Hi Greg, > > I''m on my phone at the moment so I don''t have the exact link handy, but there > is a module on GitHub that works. I tinkered with it a lot in my old setup > but found most of my problems were due to not really understanding how the > collect/export functionality worked. > > This is my favorite feature of Puppet. When I got it working, I teared up a > bit. :) > > I believe it''s http://github.com/DavidS/puppet-nagios > > > (mobile edition) > > On Sep 30, 2010, at 3:04 PM, Greg Haase <ghaase@syntheticgenomics.com> wrote: > >> Greetings, >> >> I am working on getting Nagios implemented with Puppet so that when I add a >> node to Puppet a Nagios configuration file is generated. >> >> I can get nagios installed and configured on the server and the client with >> no problems. Yet getting the client configuration file on to the server is >> not happening. I did have it working at one point in time yet It seems that >> I cannot get back to that configuration. >> >> I am relying on notation using the @@ and <<||>> I found somewhere in the >> documentation yet I did not find a proper discussion of exactly how it >> works. I don''t feel that I have a proper understanding of how it works. >> >> What I understand is that by using the >> >> @@name {} >> >> I can load data into a "global object" that is accessible from any puppet >> member. Who uses the >> >> name <<||>> >> >> Notation to call the data stored in that global object. >> >> I believe that in the past I was able to view this information on my puppet >> server with >> >> ralsh nagios_host >> >> It would give me a listing of what was stored in nagios_host. Now when I do >> this I see nothing. >> >> Here is a listing of what I understand as being a way to use this: >> >> Is this correct? >> >> >> ----------------- >> class nagios-server{ >> ........ A bunch of other stuff .......... >> file { "/etc/nagios/": >> ensure => ''directory'', >> mode => 755, >> owner => nagios, >> group => nagios, >> recurse => true; >> } >> Nagios_host <<|target == "/etc/nagios/nagios_hosts.${fqdn}.cfg"|>> >> } >> ----------------- >> class nagios-client { >> @@nagios_host { $fqdn: >> target => "/etc/nagios/nagios_hosts.${fqdn}.cfg", >> ensure => present, >> alias => $hostname, >> address => $ipaddress, >> use => "my-servers", >> check_command => "check-host-alive", >> max_check_attempts => 3, >> hostgroups => "my-servers", >> contact_groups => "admins", >> } >> ........ A bunch of other stuff .......... >> } >> ----------------- >> >> Could someone please point me in the right direction to some documentation >> that could help clarify this the use of the @@ and <<||>>? >> >> >> I''d greatly appreciate it. >> >> Thanks >> >> Greg >> Greg Haase >> ghaase@syntheticgenomics.com >> >> -- >> 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. >>-- 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.
Avi Miller
2010-Sep-30 22:48 UTC
Re: [Puppet Users] Nagios Module and use of the @@ and <<||>> notation
Greg Haase wrote:> Are you aware of any documentation that clearly explains how this > collect/export functionality works?Exporting and collecting resources relies on stored configuration[1] being enabled on your Puppet Master. You should ensure that the database is configured and working before trying to export and collect resources. Cheers, Avi [1] http://projects.puppetlabs.com/projects/1/wiki/Using_Stored_Configuration -- 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.
Greg Haase
2010-Oct-01 18:18 UTC
Re: [Puppet Users] Nagios Module and use of the @@ and <<||>> notation
Avi, I am exporting my resources to the database. I can verify that this is occurring. Yet I am not getting all of the the Nagios_host <<|target ==nagios_hosts.${fqdn}.cfg|>> files written to my nagios server and I am interested in finding out how to trace down this functionality of the collection and exportation of resources so I can properly identify how/why it is not working in all of the cases. I guess if someone could point me to a basic model of this exportation and collection process I could work from there. Is there any detailed writing about this? Greg On 9/30/10 3:48 PM, "Avi Miller" <avi.miller@gmail.com> wrote:> Greg Haase wrote: >> Are you aware of any documentation that clearly explains how this >> collect/export functionality works? > > Exporting and collecting resources relies on stored configuration[1] > being enabled on your Puppet Master. You should ensure that the database > is configured and working before trying to export and collect resources. > > Cheers, > Avi > > [1] > http://projects.puppetlabs.com/projects/1/wiki/Using_Stored_Configuration-- 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.
Daniel Pittman
2010-Oct-01 23:50 UTC
Re: [Puppet Users] Nagios Module and use of the @@ and <<||>> notation
Greg Haase <ghaase@syntheticgenomics.com> writes:> I am exporting my resources to the database. I can verify that this is > occurring. Yet I am not getting all of the the > > Nagios_host <<|target ==nagios_hosts.${fqdn}.cfg|>> > > files written to my nagios server and I am interested in finding out how to > trace down this functionality of the collection and exportation of resources > so I can properly identify how/why it is not working in all of the cases. > > I guess if someone could point me to a basic model of this exportation and > collection process I could work from there. Is there any detailed writing > about this?Not other than what folks have pointed to already, I think. I use this: ,----[ client.pp ] | @@file { "/etc/backuppc/${fqdn}.pl": | owner => ''backuppc'', group => ''www-data'', mode => 0444, | content => template(''backuppc/backuppc-client-config.pl.erb''), | tag => "backuppc-client-${backuppc_server}" | } `---- ,----[ server.pp ] | File <<| tag == "backuppc-client-${fqdn}" |>> { | require => [Package["backuppc"], File["/etc/backuppc/SDBackupPC.pm"]], | notify => Service["backuppc"], | } `---- ...which works fine for our infrastructure. It looks pretty much identical to your code, but just in case. :) Daniel -- ✣ Daniel Pittman ✉ daniel@rimspace.net ☎ +61 401 155 707 ♽ made with 100 percent post-consumer electrons -- 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.
Jeff McCune
2010-Oct-02 00:09 UTC
Re: [Puppet Users] Nagios Module and use of the @@ and <<||>> notation
On Sep 30, 2010, at 3:04 PM, Greg Haase wrote:> I believe that in the past I was able to view this information on my puppet > server with > > ralsh nagios_host > > It would give me a listing of what was stored in nagios_host. Now when I do > this I see nothing.I''m not sure if you mean that you expect ralsh nagios_host to return what has been exported and stored in the "storedconfig" SQL database, but if you do this isn''t accurate. ralsh nagios_host will use the resource abstraction layer to query the current state of all resources of type nagios_host as they exist, not as they''re stored in the database. Does the distinction make sense? It might help to run "ralsh user" or "ralsh group" to see how the ouput compares to the resources as they exist on the system. Hope this helps, -- Jeff McCune -- 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.