Phil Cole
2013-Apr-10 16:01 UTC
[Puppet Users] Managing multiple nagios servers with puppet and virtual resources
Hi, For several years, we have @work had a puppet environment where when we add a new host/node, some basic monitoring is fed through to a nagios server using virtual resources and an old nagios class which either someone here wrote themselves, or found on the internet at the time. We are trying to move away from the existing puppet environment for a number of reasons, and using this as an opportunity to tidy up our puppet classes wherever possible. Nagios integration is one area that we haven''t yet got our heads around. We would like (I think...) to be able to: * add a new node to puppet and give it an identifier to say whether it''s (say) dev/test/production etc * for the new node, define a number of basic monitors - ping, ssh etc. * have a number of nagios servers (also defined in puppet) which collect the appropriate resources for dev or test or production ie, a "dev" node would be monitored by nagios instance 1 a "test" node would be monitored by nagios instance 2 a "production" node would be monitored by nagios instance 3 etc But I''m struggling to see how I can collect the appropriate resources up on each nagios server. Has anyone tried this sort of thing? Can it be done? Any pointers in the ''right'' direction appreciated. If it''s documented anywhere and it''s just a case of RTFM, please point me in the direction of which manual to read :) Thanks in advance Phil -- 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+unsubscribe@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.
Dave Nash
2013-Apr-10 22:45 UTC
Re: [Puppet Users] Managing multiple nagios servers with puppet and virtual resources
At work we add a tag for when setting up the nagios checks in puppet tag "nagios_env:$environment" then when we realize or export the check We link the generation to the tag Nagios_serviceescalation <<| tag == "nagios_env:$environment" |>> { require => Service["nagios"], notify => Exec["nagios-safe-restart"], } and since $environment is built in and assigned to every host elsewhere the checks appear on the correct nagios server, provided they were deployed to the correct environment. --dn On Wed, Apr 10, 2013 at 9:01 AM, Phil Cole <pb.cole@gmail.com> wrote:> Hi, > > For several years, we have @work had a puppet environment where when we > add a new host/node, some basic monitoring is fed through to a nagios > server using virtual resources and an old nagios class which either someone > here wrote themselves, or found on the internet at the time. > > We are trying to move away from the existing puppet environment for a > number of reasons, and using this as an opportunity to tidy up our puppet > classes wherever possible. > > Nagios integration is one area that we haven''t yet got our heads around. > > We would like (I think...) to be able to: > * add a new node to puppet and give it an identifier to say whether it''s > (say) dev/test/production etc > * for the new node, define a number of basic monitors - ping, ssh etc. > * have a number of nagios servers (also defined in puppet) which collect > the appropriate resources for dev or test or production > > ie, a "dev" node would be monitored by nagios instance 1 > a "test" node would be monitored by nagios instance 2 > a "production" node would be monitored by nagios instance 3 > etc > > But I''m struggling to see how I can collect the appropriate resources up > on each nagios server. > > Has anyone tried this sort of thing? Can it be done? > > Any pointers in the ''right'' direction appreciated. If it''s documented > anywhere and it''s just a case of RTFM, please point me in the direction of > which manual to read :) > > Thanks in advance > > Phil > > -- > 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+unsubscribe@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. > > >-- --dn http://www.cordump.com -- 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+unsubscribe@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.
Peter Brown
2013-Apr-10 23:02 UTC
Re: [Puppet Users] Managing multiple nagios servers with puppet and virtual resources
Hi Phil, The monitoring module I wrote does this very well. It is on puppet forge if you want to have a look for some inspiration or install it and go from there :) http://forge.puppetlabs.com/rendhalver/monitoring The docs are pretty comprehensive now and explain how it all works. I basically set it up so everything is abstracted and exported using stored configs and imported to the monitoring server set in a class variable I set with hiera. The monitoring_server variable accepts an array so setting multiple monitoring servers is easy. I haven''t finished my nagios class yet because I recently switched to icinga but my monitoring module is completely agnostic. On 11 April 2013 02:01, Phil Cole <pb.cole@gmail.com> wrote:> Hi, > > For several years, we have @work had a puppet environment where when we > add a new host/node, some basic monitoring is fed through to a nagios > server using virtual resources and an old nagios class which either someone > here wrote themselves, or found on the internet at the time. > > We are trying to move away from the existing puppet environment for a > number of reasons, and using this as an opportunity to tidy up our puppet > classes wherever possible. > > Nagios integration is one area that we haven''t yet got our heads around. > > We would like (I think...) to be able to: > * add a new node to puppet and give it an identifier to say whether it''s > (say) dev/test/production etc > * for the new node, define a number of basic monitors - ping, ssh etc. > * have a number of nagios servers (also defined in puppet) which collect > the appropriate resources for dev or test or production > > ie, a "dev" node would be monitored by nagios instance 1 > a "test" node would be monitored by nagios instance 2 > a "production" node would be monitored by nagios instance 3 > etc > > But I''m struggling to see how I can collect the appropriate resources up > on each nagios server. > > Has anyone tried this sort of thing? Can it be done? > > Any pointers in the ''right'' direction appreciated. If it''s documented > anywhere and it''s just a case of RTFM, please point me in the direction of > which manual to read :) > > Thanks in advance > > Phil > > -- > 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+unsubscribe@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+unsubscribe@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.
Phil Cole
2013-Apr-11 08:10 UTC
Re: [Puppet Users] Managing multiple nagios servers with puppet and virtual resources
Thanks Dave. That sounds like the sort of thing that I was looking for, but wasn''t sure if/how it would work - I''ll give it a go. Phil On Wednesday, April 10, 2013 11:45:19 PM UTC+1, Dave Nash wrote:> > At work we add a tag for when setting up the nagios checks in puppet > > tag "nagios_env:$environment" > > then when we realize or export the check > > We link the generation to the tag > > Nagios_serviceescalation <<| tag == "nagios_env:$environment" |>> { > require => Service["nagios"], > notify => Exec["nagios-safe-restart"], > } > > and since $environment is built in and assigned to every host elsewhere > the checks appear on the correct nagios server, provided they were deployed > to the correct environment. > > --dn > > > On Wed, Apr 10, 2013 at 9:01 AM, Phil Cole <pb....@gmail.com <javascript:> > > wrote: > >> Hi, >> >> For several years, we have @work had a puppet environment where when we >> add a new host/node, some basic monitoring is fed through to a nagios >> server using virtual resources and an old nagios class which either someone >> here wrote themselves, or found on the internet at the time. >> >> We are trying to move away from the existing puppet environment for a >> number of reasons, and using this as an opportunity to tidy up our puppet >> classes wherever possible. >> >> Nagios integration is one area that we haven''t yet got our heads around. >> >> We would like (I think...) to be able to: >> * add a new node to puppet and give it an identifier to say whether it''s >> (say) dev/test/production etc >> * for the new node, define a number of basic monitors - ping, ssh etc. >> * have a number of nagios servers (also defined in puppet) which collect >> the appropriate resources for dev or test or production >> >> ie, a "dev" node would be monitored by nagios instance 1 >> a "test" node would be monitored by nagios instance 2 >> a "production" node would be monitored by nagios instance 3 >> etc >> >> But I''m struggling to see how I can collect the appropriate resources up >> on each nagios server. >> >> Has anyone tried this sort of thing? Can it be done? >> >> Any pointers in the ''right'' direction appreciated. If it''s documented >> anywhere and it''s just a case of RTFM, please point me in the direction of >> which manual to read :) >> >> Thanks in advance >> >> Phil >> >> -- >> 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...@googlegroups.com <javascript:>. >> To post to this group, send email to puppet...@googlegroups.com<javascript:> >> . >> Visit this group at http://groups.google.com/group/puppet-users?hl=en. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > > > > -- > > --dn > http://www.cordump.com >-- 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+unsubscribe@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.
Phil Cole
2013-Apr-11 08:12 UTC
Re: [Puppet Users] Managing multiple nagios servers with puppet and virtual resources
Thanks Pete, I''ll take a look at your module and see how things go. Phil On Thursday, April 11, 2013 12:02:14 AM UTC+1, Pete wrote:> > Hi Phil, > > The monitoring module I wrote does this very well. > It is on puppet forge if you want to have a look for some inspiration or > install it and go from there :) > http://forge.puppetlabs.com/rendhalver/monitoring > The docs are pretty comprehensive now and explain how it all works. > > I basically set it up so everything is abstracted and exported using > stored configs and imported to the monitoring server set in a class > variable I set with hiera. > The monitoring_server variable accepts an array so setting multiple > monitoring servers is easy. > > I haven''t finished my nagios class yet because I recently switched to > icinga but my monitoring module is completely agnostic. > > >-- 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+unsubscribe@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.
Peter Brown
2013-Apr-11 22:39 UTC
Re: [Puppet Users] Managing multiple nagios servers with puppet and virtual resources
You are welcome Phil. Hope it helps you achieve your goals. Let me know if you get stuck. Pete. On 11 April 2013 18:12, Phil Cole <pb.cole@gmail.com> wrote:> Thanks Pete, > > I''ll take a look at your module and see how things go. > > Phil > > > > On Thursday, April 11, 2013 12:02:14 AM UTC+1, Pete wrote: >> >> Hi Phil, >> >> The monitoring module I wrote does this very well. >> It is on puppet forge if you want to have a look for some inspiration or >> install it and go from there :) http://forge.puppetlabs.com/** >> rendhalver/monitoring <http://forge.puppetlabs.com/rendhalver/monitoring> >> The docs are pretty comprehensive now and explain how it all works. >> >> I basically set it up so everything is abstracted and exported using >> stored configs and imported to the monitoring server set in a class >> variable I set with hiera. >> The monitoring_server variable accepts an array so setting multiple >> monitoring servers is easy. >> >> I haven''t finished my nagios class yet because I recently switched to >> icinga but my monitoring module is completely agnostic. >> >> >> -- > 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+unsubscribe@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+unsubscribe@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.