elderdakkar
2011-May-26 11:14 UTC
[Puppet Users] Dependency of the collection of virtual ressources.
Hello i''m managing nagios with exported ressources. i have some @@nagios_host a lot of @@nagios_service ressources. Collecting the ressouces itself works fine with Nagios_host <<||>> and Nagios_service <<||>>. BUT :D i have a "special" nagios configuration layout: every host has its own cfg file with the depending servicechecks. This means i have ONE file with one host definition and all checks for this single host. And this results in one problem on the puppet side: it seems, that Nagios_service <<||>> locks the config file and the Nagios_host <<||>> process can''t write its config to the same file. The means: the first run writes some of the exported ressources to the nagios cfg. The restart of nagios fails, because some of the hosts aren''t written to the cfg. The next run does the rest and nagios restarts successful. Is there a way, to force puppet to start the collection of Nagios_service <<||>> after Nagios_host <<||>> finishes? Some kind of dependency? i already tried chaining like: Nagios_host <<||>> -> Nagios_service <<||>> , but then the puppetrun does nothing. hope i expressed myself clear :) greetings -- 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.
Adam Heinz
2011-May-26 15:11 UTC
Re: [Puppet Users] Dependency of the collection of virtual ressources.
On Thu, May 26, 2011 at 7:14 AM, elderdakkar <elderdakkar@googlemail.com> wrote:> And this > results in one problem on the puppet side: it seems, that > Nagios_service <<||>> locks the config file and the Nagios_host <<||>> > process can''t write its config to the same file.Is it a requirement that all puppet-written nagios configuration go into the same file? Personally I do something like @@nagios_host { $fqdn: target => "/etc/nagios/conf.d/nagios_host.cfg" } @@nagios_hostextinfo { $fqdn: target => "/etc/nagios/conf.d/nagios_hostextinfo.cfg" } @@nagios_service { "check_ping_$fqdn": target => "/etc/nagios/conf.d/$fqdn.cfg" } @@nagios_service { "check_http_$fqdn": target => "/etc/nagios/conf.d/$fqdn.cfg" } So my services are grouped by host, but other configuration types all go into the same file. That said -- if I had it to do again, I think I would assign my services to hostgroups in a static cfg file, and just have puppet do host 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.
jcbollinger
2011-May-27 12:50 UTC
[Puppet Users] Re: Dependency of the collection of virtual ressources.
On May 26, 6:14 am, elderdakkar <elderdak...@googlemail.com> wrote:> Hello > > i''m managing nagios with exported ressources. > i have some @@nagios_host a lot of @@nagios_service ressources. > Collecting the ressouces itself works fine with Nagios_host <<||>> and > Nagios_service <<||>>. > > BUT :D > > i have a "special" nagios configuration layout: every host has its own > cfg file with the depending servicechecks. This means i have ONE file > with one host definition and all checks for this single host. And this > results in one problem on the puppet side: it seems, that > Nagios_service <<||>> locks the config file and the Nagios_host <<||>> > process can''t write its config to the same file. The means: the first > run writes some of the exported ressources to the nagios cfg. The > restart of nagios fails, because some of the hosts aren''t written to > the cfg. The next run does the rest and nagios restarts successful. > > Is there a way, to force puppet to start the collection of > Nagios_service <<||>> after Nagios_host <<||>> finishes? > Some kind of dependency? > > i already tried chaining like: > Nagios_host <<||>> -> Nagios_service <<||>> , but then the puppetrun > does nothing.I cannot solve your problem, but for the record, the only way I can imagine the exported resource angle factoring into it is if you have a resource title crash among the resources you are trying to collect. Otherwise, you should have the same behavior with collected resources as you would have if you declared all the same resources locally. John -- 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.