jlittle
2012-Sep-10 20:17 UTC
[Puppet Users] Nagios purge deleted items and notify nagios service problem
I am using stored configs to manage my nagios host and services checks and I have run into a problem that I have been unable to solve. When the stored configs are purged from puppet the nagios server correctly removes them from the services and hosts file but does not notify the nagios service and instead throws an error. So the entries are still there and nagios still reports on them until it is restarted. (/Nagios_service[check_ping_jasontest2.wishabi.net]) Whit[Completed_stage[main]],Whit[Completed_class[Nagios3_monitor]],Service[nagios3] still depend on me -- not purging The reason that I want this feature is that I have created several automation scripts so I can start a service through AWS giving it two tags a hostname and a puppetclass. So when I decommission a server the puppetmaster recognizes this and does a puppet node clean $hostname which in turn is picked up by nagios on its next run and purged. This is the section of the nagios config that I am using to both populate and purge the items from the nagios files. # collect resources and populate /etc/nagios/nagios_*.cfg Nagios_host <<||>> { notify => Service["nagios3"] } Nagios_service <<||>> { notify => Service["nagios3"] } resources { "nagios_service": notify => Service["nagios3"] purge => true, } resources { "nagios_host": notify => Service["nagios3"] purge => true, } I can just run a cronjob to restart the nagios service periodically but that is a hacky way to do it and I would like to see if anyone has any ideas. Jason -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/GW5zxJyl-yYJ. 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.
Bruno Leon
2012-Sep-11 02:46 UTC
Re: [Puppet Users] Nagios purge deleted items and notify nagios service problem
resources { "nagios_service": # notify => Service["nagios3"] purge => true, } resources { "nagios_host": # notify => Service["nagios3"] purge => true, } And make Nagios service subrscribe to the file /etc/nagios (cheksum => mtime) -- Bruno On September 10, 2012 01:17:22 PM jlittle wrote: I am using stored configs to manage my nagios host and services checks and I have run into a problem that I have been unable to solve. When the stored configs are purged from puppet the nagios server correctly removes them from the services and hosts file but does not notify the nagios service and instead throws an error. So the entries are still there and nagios still reports on them until it is restarted. (/Nagios_service[check_ping_jasontest2.wishabi.net]) Whit[Completed_stage[main]],Whit[Completed_class[Nagios3_monitor]],Service[nagios3] still depend on me -- not purging The reason that I want this feature is that I have created several automation scripts so I can start a service through AWS giving it two tags a hostname and a puppetclass. So when I decommission a server the puppetmaster recognizes this and does a puppet node clean $hostname which in turn is picked up by nagios on its next run and purged. This is the section of the nagios config that I am using to both populate and purge the items from the nagios files. # collect resources and populate /etc/nagios/nagios_*.cfg Nagios_host <<||>> { notify => Service["nagios3"] } Nagios_service <<||>> { notify => Service["nagios3"] } resources { "nagios_service": notify => Service["nagios3"] purge => true, } resources { "nagios_host": notify => Service["nagios3"] purge => true, } I can just run a cronjob to restart the nagios service periodically but that is a hacky way to do it and I would like to see if anyone has any ideas. Jason -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/GW5zxJyl-yYJ. 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.
Gabriel Filion
2012-Sep-11 02:51 UTC
Re: [Puppet Users] Nagios purge deleted items and notify nagios service problem
On 12-09-10 10:46 PM, Bruno Leon wrote:> resources { "nagios_service": > # notify => Service["nagios3"] > purge => true, > } > > resources { "nagios_host": > # notify => Service["nagios3"] > purge => true, > } > > > > And make Nagios service subrscribe to the file /etc/nagios (cheksum => > mtime)hum, was the purge functionality ever fixed for nagios types? I''ve wanted to use that for some time but fwir it was not implemented. -- Gabriel Filion -- 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 Brown
2012-Sep-11 03:32 UTC
Re: [Puppet Users] Nagios purge deleted items and notify nagios service problem
On 11 September 2012 12:51, Gabriel Filion <lelutin@gmail.com> wrote:> On 12-09-10 10:46 PM, Bruno Leon wrote: >> resources { "nagios_service": >> # notify => Service["nagios3"] >> purge => true, >> } >> >> resources { "nagios_host": >> # notify => Service["nagios3"] >> purge => true, >> } >> >> >> >> And make Nagios service subrscribe to the file /etc/nagios (cheksum => >> mtime) > > hum, was the purge functionality ever fixed for nagios types? I''ve > wanted to use that for some time but fwir it was not implemented.Purge generally works if you don''t change the target for any of the the nagios types and keep the names the same otherwise you will have issues.> > -- > Gabriel Filion > > -- > 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.
Gabriel Filion
2012-Sep-11 15:24 UTC
Re: [Puppet Users] Nagios purge deleted items and notify nagios service problem
On 12-09-10 11:32 PM, Peter Brown wrote:>> hum, was the purge functionality ever fixed for nagios types? I''ve >> > wanted to use that for some time but fwir it was not implemented. > Purge generally works if you don''t change the target for any of the > the nagios types and keep the names the same otherwise you will have > issues.ah, you''re right the bug was with purge + changing target. (yes I do consider this as a bug even though in the code it says it''s an architectural restriction -- but I won''t bug puppetlabs with an issue about this since I can expect it to only get marked as "wontfix") -- Gabriel Filion -- 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 Brown
2012-Sep-12 00:08 UTC
Re: [Puppet Users] Nagios purge deleted items and notify nagios service problem
On 12 September 2012 01:24, Gabriel Filion <lelutin@gmail.com> wrote:> On 12-09-10 11:32 PM, Peter Brown wrote: >>> hum, was the purge functionality ever fixed for nagios types? I''ve >>> > wanted to use that for some time but fwir it was not implemented. >> Purge generally works if you don''t change the target for any of the >> the nagios types and keep the names the same otherwise you will have >> issues. > > ah, you''re right the bug was with purge + changing target. > (yes I do consider this as a bug even though in the code it says it''s an > architectural restriction -- but I won''t bug puppetlabs with an issue > about this since I can expect it to only get marked as "wontfix")yeah especially since it''s a known issue and listed in the documentation.> -- > Gabriel Filion > > -- > 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.