Hi everyone, I''m trying to automate the nagios configuration of new host through Puppet. For this I define a nagios module with the generic configuration of my Nagios host definition. The module look like this: class nagios { $packagelist=["nagios"] package { $packagelist: ensure => "installed" } $servicelist=["nagios", "httpd"] service { $servicelist: ensure => "running", hasstatus => "true", hasrestart => "true" } # collect resources and populate /etc/nagios/nagios_*.cfg Nagios_host <<| |>> Nagios_service <<| |>> Nagios_hostextinfo <<| |>> class target { @@nagios_host { $fqdn: ensure => "present", use => "ingacceso_$operatingsystem-server", alias => $hostname, address => $ipaddress, contacts => "farconada,henry,fsariego,jfdiez" } @@nagios_hostextinfo { $fqdn: ensure => "present", icon_image_alt => $operatingsystem, icon_image => "$operatingsystem.png" } @@nagios_service { "Host - Carga CPU": use => "ingacceso_generic-service", host_name => "$fqdn", check_command => "check_nrpe!check_load" } @@nagios_service { "Host - CPU": use => "ingacceso_generic- service", host_name => "$fqdn", check_command => "check_nrpe!check_cpu" } @@nagios_service { "Host - Ping": use => "ingacceso_generic- service", host_name => "$fqdn", check_command => "check_ping!400.0,20%! 900.0,60%" } @@nagios_service { "Host - /": use => "ingacceso_generic- service", host_name => "$fqdn", check_command => "check_nrpe!check_raiz" } @@nagios_service { "Host - /boot": use => "ingacceso_generic- service", host_name => "$fqdn", check_command => "check_nrpe!check_boot" } @@nagios_service { "Host - Memoria": use => "ingacceso_generic- service", host_name => "$fqdn", check_command => "check_nrpe!check_memoria" } @@nagios_service { "Host - Swap": use => "ingacceso_generic- service", host_name => "$fqdn", check_command => "check_nrpe!check_swap" } @@nagios_service { "Host - Numero Procesos": use => "ingacceso_generic- service", host_name => "$fqdn", check_command => "check_nrpe! check_total_procs" } @@nagios_service { "Host - Interfaces de Red": use => "ingacceso_generic- service", host_name => "$fqdn", check_command => "check_nrpe! check_interfaces_net" } } } After this, I include this module in the template.pp: node basenode { case $operatingsystem { centos: { include centos } default: { include centos } } include baseapps, sshd, administradores, nagiosclient include nagios::target } node default inherits basenode {} node webserver inherits basenode { include apache } node dbserver inherits basenode { include mysql } node mailserver inherits basenode { include postfix } node nagiosserver { case $operatingsystem { centos: { include centos } default: { include centos } } include baseapps, sshd, administradores, nagiosclient include nagios } Also I define my nodes in the node.pp file: node ''masterpuppet.example.int'' inherits basenode {} node ''web.example.int'' inherits webserver { apache::virtual_host { "test1.example.int": ip => "172.16.73.201" } apache::virtual_host { "test2.example.int": ip => "172.16.73.201" } } node ''db.example.int'' inherits dbserver {} node ''mail.example.int'' inherits mailserver {} node ''nagios.example.int'' inherits nagiosserver {} I verified that my store configs work well in my MySQL Database but in the reports of my Nagios host I can see this error: --- !ruby/object:Puppet::Transaction::Report configuration_version: host: nagios.example.int kind: apply logs: - !ruby/object:Puppet::Util::Log level: !ruby/sym err message: "Could not retrieve catalog from remote server: Error 400 on SERVER: Exported resource Nagios_service[Host - /] cannot override local resource on node nagios.example.int" source: Puppet tags: - err time: 2011-04-26 09:39:55.848399 +02:00 - !ruby/object:Puppet::Util::Log level: !ruby/sym notice message: Using cached catalog source: Puppet tags: - notice time: 2011-04-26 09:39:55.928445 +02:00 - !ruby/object:Puppet::Util::Log level: !ruby/sym err message: Could not retrieve catalog; skipping run source: Puppet tags: - err time: 2011-04-26 09:39:55.928687 +02:00 metrics: {} puppet_version: 2.6.6 report_format: 2 resource_statuses: {} status: failed time: 2011-04-26 09 and the files nagios_*.cfg don''t appear in my Nagios config. Can somebody help me with this troubleshoot? Ref: http://blog.gurski.org/index.php/2010/01/28/automatic-monitoring-with-puppet-and-nagios/ -- 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.
Hello, Maybe have a look at our nagios module: https://github.com/camptocamp/puppet-nagios Your problem is that resources with same name are exported from multiple hosts, and that make puppet crash with duplicated definition (as it''s exported resources, the error message is different ;) ). You should name your nagios resources with the fqdn embedded so that it will be really unique across the DB. Cheers, C. On Tue, 26 Apr 2011 01:29:03 -0700 (PDT) Fransua33 <mochu33@gmail.com> wrote:> Hi everyone, > > I''m trying to automate the nagios configuration of new host through > Puppet. For this I define a nagios module with the generic > configuration of my Nagios host definition. The module look like > this: > > class nagios { > $packagelist=["nagios"] > > package { $packagelist: > ensure => "installed" > } > > $servicelist=["nagios", "httpd"] > > service { $servicelist: > ensure => "running", > hasstatus => "true", > hasrestart => "true" > } > > # collect resources and populate /etc/nagios/nagios_*.cfg > Nagios_host <<| |>> > Nagios_service <<| |>> > Nagios_hostextinfo <<| |>> > > class target { > @@nagios_host { $fqdn: > ensure => "present", > use => "ingacceso_$operatingsystem-server", > alias => $hostname, > address => $ipaddress, > contacts => "farconada,henry,fsariego,jfdiez" > } > > @@nagios_hostextinfo { $fqdn: > ensure => "present", > icon_image_alt => $operatingsystem, > icon_image => "$operatingsystem.png" > } > > @@nagios_service { "Host - Carga CPU": > use => "ingacceso_generic-service", > host_name => "$fqdn", > check_command => "check_nrpe!check_load" > } > > @@nagios_service { "Host - CPU": > use => "ingacceso_generic- > service", > host_name => "$fqdn", > check_command => "check_nrpe!check_cpu" > } > > @@nagios_service { "Host - Ping": > use => "ingacceso_generic- > service", > host_name => "$fqdn", > check_command => "check_ping!400.0,20%! > 900.0,60%" > } > > @@nagios_service { "Host - /": > use => "ingacceso_generic- > service", > host_name => "$fqdn", > check_command => "check_nrpe!check_raiz" > } > > @@nagios_service { "Host - /boot": > use => "ingacceso_generic- > service", > host_name => "$fqdn", > check_command => "check_nrpe!check_boot" > } > > @@nagios_service { "Host - Memoria": > use => "ingacceso_generic- > service", > host_name => "$fqdn", > check_command => "check_nrpe!check_memoria" > } > > @@nagios_service { "Host - Swap": > use => "ingacceso_generic- > service", > host_name => "$fqdn", > check_command => "check_nrpe!check_swap" > } > > @@nagios_service { "Host - Numero Procesos": > use => "ingacceso_generic- > service", > host_name => "$fqdn", > check_command => "check_nrpe! > check_total_procs" > } > > > @@nagios_service { "Host - Interfaces de Red": > use => "ingacceso_generic- > service", > host_name => "$fqdn", > check_command => "check_nrpe! > check_interfaces_net" > } > } > } > > After this, I include this module in the template.pp: > > node basenode { > case $operatingsystem { > centos: { include centos } > default: { include centos } > } > include baseapps, sshd, administradores, nagiosclient > include nagios::target > } > node default inherits basenode {} > node webserver inherits basenode { > include apache > } > node dbserver inherits basenode { > include mysql > } > node mailserver inherits basenode { > include postfix > } > node nagiosserver { > case $operatingsystem { > centos: { include centos } > default: { include centos } > } > include baseapps, sshd, administradores, nagiosclient > include nagios > } > > Also I define my nodes in the node.pp file: > > node ''masterpuppet.example.int'' inherits basenode {} > node ''web.example.int'' inherits webserver { > apache::virtual_host { "test1.example.int": > ip => "172.16.73.201" > } > apache::virtual_host { "test2.example.int": > ip => "172.16.73.201" > } > } > node ''db.example.int'' inherits dbserver {} > node ''mail.example.int'' inherits mailserver {} > node ''nagios.example.int'' inherits nagiosserver {} > > I verified that my store configs work well in my MySQL Database but in > the reports of my Nagios host I can see this error: > > --- !ruby/object:Puppet::Transaction::Report > configuration_version: > host: nagios.example.int > kind: apply > logs: > - !ruby/object:Puppet::Util::Log > level: !ruby/sym err > message: "Could not retrieve catalog from remote server: Error > 400 on SERVER: Exported resource Nagios_service[Host - /] cannot > override local resource on node nagios.example.int" > source: Puppet > tags: > - err > time: 2011-04-26 09:39:55.848399 +02:00 > - !ruby/object:Puppet::Util::Log > level: !ruby/sym notice > message: Using cached catalog > source: Puppet > tags: > - notice > time: 2011-04-26 09:39:55.928445 +02:00 > - !ruby/object:Puppet::Util::Log > level: !ruby/sym err > message: Could not retrieve catalog; skipping run > source: Puppet > tags: > - err > time: 2011-04-26 09:39:55.928687 +02:00 > metrics: {} > puppet_version: 2.6.6 > report_format: 2 > resource_statuses: {} > status: failed > time: 2011-04-26 09 > > and the files nagios_*.cfg don''t appear in my Nagios config. > > Can somebody help me with this troubleshoot? > > Ref: http://blog.gurski.org/index.php/2010/01/28/automatic-monitoring-with-puppet-and-nagios/ >-- Cédric Jeanneret | System Administrator 021 619 10 32 | Camptocamp SA cedric.jeanneret@camptocamp.com | PSE-A / EPFL
Juan-Francisco Diez
2011-Apr-26 09:48 UTC
Re: [Puppet Users] Automating Nagios with Puppet
OK, thenks for your help. I solved the trouble using the $hostname fact in front of services definitions. But I have another question about this: Is it possible to define the directory where the file are created in the nagios server? Now the files are stored in the /etc/nagios. 2011/4/26 Cedric Jeanneret <cedric.jeanneret@camptocamp.com>> Hello, > > Maybe have a look at our nagios module: > https://github.com/camptocamp/puppet-nagios > > Your problem is that resources with same name are exported from multiple > hosts, and that make puppet crash with duplicated definition (as it''s > exported resources, the error message is different ;) ). > You should name your nagios resources with the fqdn embedded so that it > will be really unique across the DB. > > Cheers, > > C. > > On Tue, 26 Apr 2011 01:29:03 -0700 (PDT) > Fransua33 <mochu33@gmail.com> wrote: > > > Hi everyone, > > > > I''m trying to automate the nagios configuration of new host through > > Puppet. For this I define a nagios module with the generic > > configuration of my Nagios host definition. The module look like > > this: > > > > class nagios { > > $packagelist=["nagios"] > > > > package { $packagelist: > > ensure => "installed" > > } > > > > $servicelist=["nagios", "httpd"] > > > > service { $servicelist: > > ensure => "running", > > hasstatus => "true", > > hasrestart => "true" > > } > > > > # collect resources and populate /etc/nagios/nagios_*.cfg > > Nagios_host <<| |>> > > Nagios_service <<| |>> > > Nagios_hostextinfo <<| |>> > > > > class target { > > @@nagios_host { $fqdn: > > ensure => "present", > > use => > "ingacceso_$operatingsystem-server", > > alias => $hostname, > > address => $ipaddress, > > contacts => > "farconada,henry,fsariego,jfdiez" > > } > > > > @@nagios_hostextinfo { $fqdn: > > ensure => "present", > > icon_image_alt => $operatingsystem, > > icon_image => "$operatingsystem.png" > > } > > > > @@nagios_service { "Host - Carga CPU": > > use => "ingacceso_generic-service", > > host_name => "$fqdn", > > check_command => "check_nrpe!check_load" > > } > > > > @@nagios_service { "Host - CPU": > > use => "ingacceso_generic- > > service", > > host_name => "$fqdn", > > check_command => "check_nrpe!check_cpu" > > } > > > > @@nagios_service { "Host - Ping": > > use => "ingacceso_generic- > > service", > > host_name => "$fqdn", > > check_command => "check_ping!400.0,20%! > > 900.0,60%" > > } > > > > @@nagios_service { "Host - /": > > use => "ingacceso_generic- > > service", > > host_name => "$fqdn", > > check_command => "check_nrpe!check_raiz" > > } > > > > @@nagios_service { "Host - /boot": > > use => "ingacceso_generic- > > service", > > host_name => "$fqdn", > > check_command => "check_nrpe!check_boot" > > } > > > > @@nagios_service { "Host - Memoria": > > use => "ingacceso_generic- > > service", > > host_name => "$fqdn", > > check_command => "check_nrpe!check_memoria" > > } > > > > @@nagios_service { "Host - Swap": > > use => "ingacceso_generic- > > service", > > host_name => "$fqdn", > > check_command => "check_nrpe!check_swap" > > } > > > > @@nagios_service { "Host - Numero Procesos": > > use => "ingacceso_generic- > > service", > > host_name => "$fqdn", > > check_command => "check_nrpe! > > check_total_procs" > > } > > > > > > @@nagios_service { "Host - Interfaces de Red": > > use => "ingacceso_generic- > > service", > > host_name => "$fqdn", > > check_command => "check_nrpe! > > check_interfaces_net" > > } > > } > > } > > > > After this, I include this module in the template.pp: > > > > node basenode { > > case $operatingsystem { > > centos: { include centos } > > default: { include centos } > > } > > include baseapps, sshd, administradores, nagiosclient > > include nagios::target > > } > > node default inherits basenode {} > > node webserver inherits basenode { > > include apache > > } > > node dbserver inherits basenode { > > include mysql > > } > > node mailserver inherits basenode { > > include postfix > > } > > node nagiosserver { > > case $operatingsystem { > > centos: { include centos } > > default: { include centos } > > } > > include baseapps, sshd, administradores, nagiosclient > > include nagios > > } > > > > Also I define my nodes in the node.pp file: > > > > node ''masterpuppet.example.int'' inherits basenode {} > > node ''web.example.int'' inherits webserver { > > apache::virtual_host { "test1.example.int": > > ip => "172.16.73.201" > > } > > apache::virtual_host { "test2.example.int": > > ip => "172.16.73.201" > > } > > } > > node ''db.example.int'' inherits dbserver {} > > node ''mail.example.int'' inherits mailserver {} > > node ''nagios.example.int'' inherits nagiosserver {} > > > > I verified that my store configs work well in my MySQL Database but in > > the reports of my Nagios host I can see this error: > > > > --- !ruby/object:Puppet::Transaction::Report > > configuration_version: > > host: nagios.example.int > > kind: apply > > logs: > > - !ruby/object:Puppet::Util::Log > > level: !ruby/sym err > > message: "Could not retrieve catalog from remote server: Error > > 400 on SERVER: Exported resource Nagios_service[Host - /] cannot > > override local resource on node nagios.example.int" > > source: Puppet > > tags: > > - err > > time: 2011-04-26 09:39:55.848399 +02:00 > > - !ruby/object:Puppet::Util::Log > > level: !ruby/sym notice > > message: Using cached catalog > > source: Puppet > > tags: > > - notice > > time: 2011-04-26 09:39:55.928445 +02:00 > > - !ruby/object:Puppet::Util::Log > > level: !ruby/sym err > > message: Could not retrieve catalog; skipping run > > source: Puppet > > tags: > > - err > > time: 2011-04-26 09:39:55.928687 +02:00 > > metrics: {} > > puppet_version: 2.6.6 > > report_format: 2 > > resource_statuses: {} > > status: failed > > time: 2011-04-26 09 > > > > and the files nagios_*.cfg don''t appear in my Nagios config. > > > > Can somebody help me with this troubleshoot? > > > > Ref: > http://blog.gurski.org/index.php/2010/01/28/automatic-monitoring-with-puppet-and-nagios/ > > > > > -- > Cédric Jeanneret | System Administrator > 021 619 10 32 | Camptocamp SA > cedric.jeanneret@camptocamp.com | PSE-A / EPFL >-- 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.
Hello again, Yes, of course you can change the directory. Check out the mentioned module, we put all the nagios stuff in /etc/nagios.d directory, keeping clean a /etc/nagios3 directory. For what I''ve seen, it seems to do exactly what you''re trying to do. For the basic: nagios accept different directories for its configuration, you have to add them in your nagios.cfg file using the cfg_dir directive. This can be done using either a simple file, a template or with augeas (not sure for the latest point). Cheers, C. On Tue, 26 Apr 2011 11:48:32 +0200 Juan-Francisco Diez <mochu33@gmail.com> wrote:> OK, thenks for your help. I solved the trouble using the $hostname fact in > front of services definitions. > > But I have another question about this: > > Is it possible to define the directory where the file are created in the > nagios server? > > Now the files are stored in the /etc/nagios. > > > 2011/4/26 Cedric Jeanneret <cedric.jeanneret@camptocamp.com> > > > Hello, > > > > Maybe have a look at our nagios module: > > https://github.com/camptocamp/puppet-nagios > > > > Your problem is that resources with same name are exported from multiple > > hosts, and that make puppet crash with duplicated definition (as it''s > > exported resources, the error message is different ;) ). > > You should name your nagios resources with the fqdn embedded so that it > > will be really unique across the DB. > > > > Cheers, > > > > C. > > > > On Tue, 26 Apr 2011 01:29:03 -0700 (PDT) > > Fransua33 <mochu33@gmail.com> wrote: > > > > > Hi everyone, > > > > > > I''m trying to automate the nagios configuration of new host through > > > Puppet. For this I define a nagios module with the generic > > > configuration of my Nagios host definition. The module look like > > > this: > > > > > > class nagios { > > > $packagelist=["nagios"] > > > > > > package { $packagelist: > > > ensure => "installed" > > > } > > > > > > $servicelist=["nagios", "httpd"] > > > > > > service { $servicelist: > > > ensure => "running", > > > hasstatus => "true", > > > hasrestart => "true" > > > } > > > > > > # collect resources and populate /etc/nagios/nagios_*.cfg > > > Nagios_host <<| |>> > > > Nagios_service <<| |>> > > > Nagios_hostextinfo <<| |>> > > > > > > class target { > > > @@nagios_host { $fqdn: > > > ensure => "present", > > > use => > > "ingacceso_$operatingsystem-server", > > > alias => $hostname, > > > address => $ipaddress, > > > contacts => > > "farconada,henry,fsariego,jfdiez" > > > } > > > > > > @@nagios_hostextinfo { $fqdn: > > > ensure => "present", > > > icon_image_alt => $operatingsystem, > > > icon_image => "$operatingsystem.png" > > > } > > > > > > @@nagios_service { "Host - Carga CPU": > > > use => "ingacceso_generic-service", > > > host_name => "$fqdn", > > > check_command => "check_nrpe!check_load" > > > } > > > > > > @@nagios_service { "Host - CPU": > > > use => "ingacceso_generic- > > > service", > > > host_name => "$fqdn", > > > check_command => "check_nrpe!check_cpu" > > > } > > > > > > @@nagios_service { "Host - Ping": > > > use => "ingacceso_generic- > > > service", > > > host_name => "$fqdn", > > > check_command => "check_ping!400.0,20%! > > > 900.0,60%" > > > } > > > > > > @@nagios_service { "Host - /": > > > use => "ingacceso_generic- > > > service", > > > host_name => "$fqdn", > > > check_command => "check_nrpe!check_raiz" > > > } > > > > > > @@nagios_service { "Host - /boot": > > > use => "ingacceso_generic- > > > service", > > > host_name => "$fqdn", > > > check_command => "check_nrpe!check_boot" > > > } > > > > > > @@nagios_service { "Host - Memoria": > > > use => "ingacceso_generic- > > > service", > > > host_name => "$fqdn", > > > check_command => "check_nrpe!check_memoria" > > > } > > > > > > @@nagios_service { "Host - Swap": > > > use => "ingacceso_generic- > > > service", > > > host_name => "$fqdn", > > > check_command => "check_nrpe!check_swap" > > > } > > > > > > @@nagios_service { "Host - Numero Procesos": > > > use => "ingacceso_generic- > > > service", > > > host_name => "$fqdn", > > > check_command => "check_nrpe! > > > check_total_procs" > > > } > > > > > > > > > @@nagios_service { "Host - Interfaces de Red": > > > use => "ingacceso_generic- > > > service", > > > host_name => "$fqdn", > > > check_command => "check_nrpe! > > > check_interfaces_net" > > > } > > > } > > > } > > > > > > After this, I include this module in the template.pp: > > > > > > node basenode { > > > case $operatingsystem { > > > centos: { include centos } > > > default: { include centos } > > > } > > > include baseapps, sshd, administradores, nagiosclient > > > include nagios::target > > > } > > > node default inherits basenode {} > > > node webserver inherits basenode { > > > include apache > > > } > > > node dbserver inherits basenode { > > > include mysql > > > } > > > node mailserver inherits basenode { > > > include postfix > > > } > > > node nagiosserver { > > > case $operatingsystem { > > > centos: { include centos } > > > default: { include centos } > > > } > > > include baseapps, sshd, administradores, nagiosclient > > > include nagios > > > } > > > > > > Also I define my nodes in the node.pp file: > > > > > > node ''masterpuppet.example.int'' inherits basenode {} > > > node ''web.example.int'' inherits webserver { > > > apache::virtual_host { "test1.example.int": > > > ip => "172.16.73.201" > > > } > > > apache::virtual_host { "test2.example.int": > > > ip => "172.16.73.201" > > > } > > > } > > > node ''db.example.int'' inherits dbserver {} > > > node ''mail.example.int'' inherits mailserver {} > > > node ''nagios.example.int'' inherits nagiosserver {} > > > > > > I verified that my store configs work well in my MySQL Database but in > > > the reports of my Nagios host I can see this error: > > > > > > --- !ruby/object:Puppet::Transaction::Report > > > configuration_version: > > > host: nagios.example.int > > > kind: apply > > > logs: > > > - !ruby/object:Puppet::Util::Log > > > level: !ruby/sym err > > > message: "Could not retrieve catalog from remote server: Error > > > 400 on SERVER: Exported resource Nagios_service[Host - /] cannot > > > override local resource on node nagios.example.int" > > > source: Puppet > > > tags: > > > - err > > > time: 2011-04-26 09:39:55.848399 +02:00 > > > - !ruby/object:Puppet::Util::Log > > > level: !ruby/sym notice > > > message: Using cached catalog > > > source: Puppet > > > tags: > > > - notice > > > time: 2011-04-26 09:39:55.928445 +02:00 > > > - !ruby/object:Puppet::Util::Log > > > level: !ruby/sym err > > > message: Could not retrieve catalog; skipping run > > > source: Puppet > > > tags: > > > - err > > > time: 2011-04-26 09:39:55.928687 +02:00 > > > metrics: {} > > > puppet_version: 2.6.6 > > > report_format: 2 > > > resource_statuses: {} > > > status: failed > > > time: 2011-04-26 09 > > > > > > and the files nagios_*.cfg don''t appear in my Nagios config. > > > > > > Can somebody help me with this troubleshoot? > > > > > > Ref: > > http://blog.gurski.org/index.php/2010/01/28/automatic-monitoring-with-puppet-and-nagios/ > > > > > > > > > -- > > Cédric Jeanneret | System Administrator > > 021 619 10 32 | Camptocamp SA > > cedric.jeanneret@camptocamp.com | PSE-A / EPFL > > >-- Cédric Jeanneret | System Administrator 021 619 10 32 | Camptocamp SA cedric.jeanneret@camptocamp.com | PSE-A / EPFL
Hello, On 11-04-26 05:48 AM, Juan-Francisco Diez wrote:> OK, thenks for your help. I solved the trouble using the $hostname fact > in front of services definitions. > > But I have another question about this: > > Is it possible to define the directory where the file are created in the > nagios server? > > Now the files are stored in the /etc/nagios.Yes, that''s possible. Check out this page for more info on the nagios_* resources: http://docs.puppetlabs.com/references/stable/type.html hint: the nagios_* all have a metaparameter named "target" which is described on this page as doing "target" .... that''s what you want: set that parameter to the path of the file that should contain each resource.> 2011/4/26 Cedric Jeanneret <cedric.jeanneret@camptocamp.com > <mailto:cedric.jeanneret@camptocamp.com>> > > Hello, > > Maybe have a look at our nagios module: > https://github.com/camptocamp/puppet-nagios > > Your problem is that resources with same name are exported from > multiple hosts, and that make puppet crash with duplicated > definition (as it''s exported resources, the error message is > different ;) ). > You should name your nagios resources with the fqdn embedded so that > it will be really unique across the DB. > > Cheers, > > C. > > On Tue, 26 Apr 2011 01:29:03 -0700 (PDT) > Fransua33 <mochu33@gmail.com <mailto:mochu33@gmail.com>> wrote: > > > Hi everyone, > > > > I''m trying to automate the nagios configuration of new host through > > Puppet. For this I define a nagios module with the generic > > configuration of my Nagios host definition. The module look like > > this: > > > > class nagios { > > $packagelist=["nagios"] > > > > package { $packagelist: > > ensure => "installed" > > } > > > > $servicelist=["nagios", "httpd"] > > > > service { $servicelist: > > ensure => "running", > > hasstatus => "true", > > hasrestart => "true" > > } > > > > # collect resources and populate /etc/nagios/nagios_*.cfg > > Nagios_host <<| |>> > > Nagios_service <<| |>> > > Nagios_hostextinfo <<| |>> > > > > class target { > > @@nagios_host { $fqdn: > > ensure => "present", > > use => > "ingacceso_$operatingsystem-server", > > alias => $hostname, > > address => $ipaddress, > > contacts => > "farconada,henry,fsariego,jfdiez" > > } > > > > @@nagios_hostextinfo { $fqdn: > > ensure => "present", > > icon_image_alt => $operatingsystem, > > icon_image => "$operatingsystem.png" > > } > > > > @@nagios_service { "Host - Carga CPU": > > use => "ingacceso_generic-service", > > host_name => "$fqdn", > > check_command => "check_nrpe!check_load" > > } > > > > @@nagios_service { "Host - CPU": > > use => "ingacceso_generic- > > service", > > host_name => "$fqdn", > > check_command => "check_nrpe!check_cpu" > > } > > > > @@nagios_service { "Host - Ping": > > use => "ingacceso_generic- > > service", > > host_name => "$fqdn", > > check_command => "check_ping!400.0,20%! > > 900.0,60%" > > } > > > > @@nagios_service { "Host - /": > > use => "ingacceso_generic- > > service", > > host_name => "$fqdn", > > check_command => "check_nrpe!check_raiz" > > } > > > > @@nagios_service { "Host - /boot": > > use => "ingacceso_generic- > > service", > > host_name => "$fqdn", > > check_command => "check_nrpe!check_boot" > > } > > > > @@nagios_service { "Host - Memoria": > > use => "ingacceso_generic- > > service", > > host_name => "$fqdn", > > check_command => "check_nrpe!check_memoria" > > } > > > > @@nagios_service { "Host - Swap": > > use => "ingacceso_generic- > > service", > > host_name => "$fqdn", > > check_command => "check_nrpe!check_swap" > > } > > > > @@nagios_service { "Host - Numero Procesos": > > use => "ingacceso_generic- > > service", > > host_name => "$fqdn", > > check_command => "check_nrpe! > > check_total_procs" > > } > > > > > > @@nagios_service { "Host - Interfaces de Red": > > use => "ingacceso_generic- > > service", > > host_name => "$fqdn", > > check_command => "check_nrpe! > > check_interfaces_net" > > } > > } > > } > > > > After this, I include this module in the template.pp: > > > > node basenode { > > case $operatingsystem { > > centos: { include centos } > > default: { include centos } > > } > > include baseapps, sshd, administradores, nagiosclient > > include nagios::target > > } > > node default inherits basenode {} > > node webserver inherits basenode { > > include apache > > } > > node dbserver inherits basenode { > > include mysql > > } > > node mailserver inherits basenode { > > include postfix > > } > > node nagiosserver { > > case $operatingsystem { > > centos: { include centos } > > default: { include centos } > > } > > include baseapps, sshd, administradores, nagiosclient > > include nagios > > } > > > > Also I define my nodes in the node.pp file: > > > > node ''masterpuppet.example.int <http://masterpuppet.example.int>'' > inherits basenode {} > > node ''web.example.int <http://web.example.int>'' inherits webserver { > > apache::virtual_host { "test1.example.int > <http://test1.example.int>": > > ip => "172.16.73.201" > > } > > apache::virtual_host { "test2.example.int > <http://test2.example.int>": > > ip => "172.16.73.201" > > } > > } > > node ''db.example.int <http://db.example.int>'' inherits dbserver {} > > node ''mail.example.int <http://mail.example.int>'' inherits > mailserver {} > > node ''nagios.example.int <http://nagios.example.int>'' inherits > nagiosserver {} > > > > I verified that my store configs work well in my MySQL Database but in > > the reports of my Nagios host I can see this error: > > > > --- !ruby/object:Puppet::Transaction::Report > > configuration_version: > > host: nagios.example.int <http://nagios.example.int> > > kind: apply > > logs: > > - !ruby/object:Puppet::Util::Log > > level: !ruby/sym err > > message: "Could not retrieve catalog from remote server: Error > > 400 on SERVER: Exported resource Nagios_service[Host - /] cannot > > override local resource on node nagios.example.int > <http://nagios.example.int>" > > source: Puppet > > tags: > > - err > > time: 2011-04-26 09:39:55.848399 +02:00 > > - !ruby/object:Puppet::Util::Log > > level: !ruby/sym notice > > message: Using cached catalog > > source: Puppet > > tags: > > - notice > > time: 2011-04-26 09:39:55.928445 +02:00 > > - !ruby/object:Puppet::Util::Log > > level: !ruby/sym err > > message: Could not retrieve catalog; skipping run > > source: Puppet > > tags: > > - err > > time: 2011-04-26 09:39:55.928687 +02:00 > > metrics: {} > > puppet_version: 2.6.6 > > report_format: 2 > > resource_statuses: {} > > status: failed > > time: 2011-04-26 09 > > > > and the files nagios_*.cfg don''t appear in my Nagios config. > > > > Can somebody help me with this troubleshoot? > > > > Ref: > http://blog.gurski.org/index.php/2010/01/28/automatic-monitoring-with-puppet-and-nagios/ > >-- 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.
Just one question: On Apr 26, 9:29 am, Fransua33 <moch...@gmail.com> wrote:> [ .... ] > > $servicelist=["nagios", "httpd"] > > service { $servicelist: > ensure => "running", > hasstatus => "true", > hasrestart => "true" > } >Do you really need to run "httpd" on the client node to run Nagios client?> > Ref:http://blog.gurski.org/index.php/2010/01/28/automatic-monitoring-with... >Very useful link; I''m trying to do the same thing. Thanks you. Cheers!! -- 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.
Hello, On 11-04-28 05:55 AM, Sans wrote:> On Apr 26, 9:29 am, Fransua33 <moch...@gmail.com> wrote: >> > [ .... ] >> > >> > $servicelist=["nagios", "httpd"] >> > >> > service { $servicelist: >> > ensure => "running", >> > hasstatus => "true", >> > hasrestart => "true" >> > } >> > > Do you really need to run "httpd" on the client node to run Nagios > client?Judging from the manifests that the OP sent, the HTTP server is run on the nagios server, not on each node: the "nagios" class is included only on the node ''nagiosserver'', while the class "nagios::target" is included everywhere. It is possible to run a Nagios server without a web server, but you won''t be able to access its web interface. -- 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.
Hi Gabriel, I overlooked the "nagios::target" class. Thanks for pointing that out. Cheers!! On Apr 28, 5:14 pm, Gabriel Filion <lelu...@gmail.com> wrote:> Hello, > > Judging from the manifests that the OP sent, the HTTP server is run on > the nagios server, not on each node: the "nagios" class is included only > on the node ''nagiosserver'', while the class "nagios::target" is included > everywhere. > > It is possible to run a Nagios server without a web server, but you > won''t be able to access its web interface. > > -- > 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.
Hi Gabriel, I overlooked the "nagios::target" class. Thanks for pointing that out. Cheers!! On Apr 28, 5:14 pm, Gabriel Filion <lelu...@gmail.com> wrote:> Hello, > > Judging from the manifests that the OP sent, the HTTP server is run on > the nagios server, not on each node: the "nagios" class is included only > on the node ''nagiosserver'', while the class "nagios::target" is included > everywhere. > > It is possible to run a Nagios server without a web server, but you > won''t be able to access its web interface. > > -- > 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.
Hi, beware of this if you change default file locations: "You can purge Nagios resources using the resources type, but only in the default file locations. This is an architectural limitation" on Debian I prefer to link /etc/nagios3/conf.d to /etc/nagios greetings, Lluís El dt 26 de 04 de 2011 a les 12:44 +0200, en/na Cedric Jeanneret va escriure:> Hello again, > > Yes, of course you can change the directory. > > Check out the mentioned module, we put all the nagios stuff in /etc/nagios.d directory, keeping clean a /etc/nagios3 directory. For what I''ve seen, it seems to do exactly what you''re trying to do. > > For the basic: > nagios accept different directories for its configuration, you have to add them in your nagios.cfg file using the cfg_dir directive. This can be done using either a simple file, a template or with augeas (not sure for the latest point). > > Cheers, > > C. > > On Tue, 26 Apr 2011 11:48:32 +0200 > Juan-Francisco Diez <mochu33@gmail.com> wrote: > > > OK, thenks for your help. I solved the trouble using the $hostname fact in > > front of services definitions. > > > > But I have another question about this: > > > > Is it possible to define the directory where the file are created in the > > nagios server? > > > > Now the files are stored in the /etc/nagios. > > > > > > 2011/4/26 Cedric Jeanneret <cedric.jeanneret@camptocamp.com> > > > > > Hello, > > > > > > Maybe have a look at our nagios module: > > > https://github.com/camptocamp/puppet-nagios > > > > > > Your problem is that resources with same name are exported from multiple > > > hosts, and that make puppet crash with duplicated definition (as it''s > > > exported resources, the error message is different ;) ). > > > You should name your nagios resources with the fqdn embedded so that it > > > will be really unique across the DB. > > > > > > Cheers, > > > > > > C. > > > > > > On Tue, 26 Apr 2011 01:29:03 -0700 (PDT) > > > Fransua33 <mochu33@gmail.com> wrote: > > > > > > > Hi everyone, > > > > > > > > I''m trying to automate the nagios configuration of new host through > > > > Puppet. For this I define a nagios module with the generic > > > > configuration of my Nagios host definition. The module look like > > > > this: > > > > > > > > class nagios { > > > > $packagelist=["nagios"] > > > > > > > > package { $packagelist: > > > > ensure => "installed" > > > > } > > > > > > > > $servicelist=["nagios", "httpd"] > > > > > > > > service { $servicelist: > > > > ensure => "running", > > > > hasstatus => "true", > > > > hasrestart => "true" > > > > } > > > > > > > > # collect resources and populate /etc/nagios/nagios_*.cfg > > > > Nagios_host <<| |>> > > > > Nagios_service <<| |>> > > > > Nagios_hostextinfo <<| |>> > > > > > > > > class target { > > > > @@nagios_host { $fqdn: > > > > ensure => "present", > > > > use => > > > "ingacceso_$operatingsystem-server", > > > > alias => $hostname, > > > > address => $ipaddress, > > > > contacts => > > > "farconada,henry,fsariego,jfdiez" > > > > } > > > > > > > > @@nagios_hostextinfo { $fqdn: > > > > ensure => "present", > > > > icon_image_alt => $operatingsystem, > > > > icon_image => "$operatingsystem.png" > > > > } > > > > > > > > @@nagios_service { "Host - Carga CPU": > > > > use => "ingacceso_generic-service", > > > > host_name => "$fqdn", > > > > check_command => "check_nrpe!check_load" > > > > } > > > > > > > > @@nagios_service { "Host - CPU": > > > > use => "ingacceso_generic- > > > > service", > > > > host_name => "$fqdn", > > > > check_command => "check_nrpe!check_cpu" > > > > } > > > > > > > > @@nagios_service { "Host - Ping": > > > > use => "ingacceso_generic- > > > > service", > > > > host_name => "$fqdn", > > > > check_command => "check_ping!400.0,20%! > > > > 900.0,60%" > > > > } > > > > > > > > @@nagios_service { "Host - /": > > > > use => "ingacceso_generic- > > > > service", > > > > host_name => "$fqdn", > > > > check_command => "check_nrpe!check_raiz" > > > > } > > > > > > > > @@nagios_service { "Host - /boot": > > > > use => "ingacceso_generic- > > > > service", > > > > host_name => "$fqdn", > > > > check_command => "check_nrpe!check_boot" > > > > } > > > > > > > > @@nagios_service { "Host - Memoria": > > > > use => "ingacceso_generic- > > > > service", > > > > host_name => "$fqdn", > > > > check_command => "check_nrpe!check_memoria" > > > > } > > > > > > > > @@nagios_service { "Host - Swap": > > > > use => "ingacceso_generic- > > > > service", > > > > host_name => "$fqdn", > > > > check_command => "check_nrpe!check_swap" > > > > } > > > > > > > > @@nagios_service { "Host - Numero Procesos": > > > > use => "ingacceso_generic- > > > > service", > > > > host_name => "$fqdn", > > > > check_command => "check_nrpe! > > > > check_total_procs" > > > > } > > > > > > > > > > > > @@nagios_service { "Host - Interfaces de Red": > > > > use => "ingacceso_generic- > > > > service", > > > > host_name => "$fqdn", > > > > check_command => "check_nrpe! > > > > check_interfaces_net" > > > > } > > > > } > > > > } > > > > > > > > After this, I include this module in the template.pp: > > > > > > > > node basenode { > > > > case $operatingsystem { > > > > centos: { include centos } > > > > default: { include centos } > > > > } > > > > include baseapps, sshd, administradores, nagiosclient > > > > include nagios::target > > > > } > > > > node default inherits basenode {} > > > > node webserver inherits basenode { > > > > include apache > > > > } > > > > node dbserver inherits basenode { > > > > include mysql > > > > } > > > > node mailserver inherits basenode { > > > > include postfix > > > > } > > > > node nagiosserver { > > > > case $operatingsystem { > > > > centos: { include centos } > > > > default: { include centos } > > > > } > > > > include baseapps, sshd, administradores, nagiosclient > > > > include nagios > > > > } > > > > > > > > Also I define my nodes in the node.pp file: > > > > > > > > node ''masterpuppet.example.int'' inherits basenode {} > > > > node ''web.example.int'' inherits webserver { > > > > apache::virtual_host { "test1.example.int": > > > > ip => "172.16.73.201" > > > > } > > > > apache::virtual_host { "test2.example.int": > > > > ip => "172.16.73.201" > > > > } > > > > } > > > > node ''db.example.int'' inherits dbserver {} > > > > node ''mail.example.int'' inherits mailserver {} > > > > node ''nagios.example.int'' inherits nagiosserver {} > > > > > > > > I verified that my store configs work well in my MySQL Database but in > > > > the reports of my Nagios host I can see this error: > > > > > > > > --- !ruby/object:Puppet::Transaction::Report > > > > configuration_version: > > > > host: nagios.example.int > > > > kind: apply > > > > logs: > > > > - !ruby/object:Puppet::Util::Log > > > > level: !ruby/sym err > > > > message: "Could not retrieve catalog from remote server: Error > > > > 400 on SERVER: Exported resource Nagios_service[Host - /] cannot > > > > override local resource on node nagios.example.int" > > > > source: Puppet > > > > tags: > > > > - err > > > > time: 2011-04-26 09:39:55.848399 +02:00 > > > > - !ruby/object:Puppet::Util::Log > > > > level: !ruby/sym notice > > > > message: Using cached catalog > > > > source: Puppet > > > > tags: > > > > - notice > > > > time: 2011-04-26 09:39:55.928445 +02:00 > > > > - !ruby/object:Puppet::Util::Log > > > > level: !ruby/sym err > > > > message: Could not retrieve catalog; skipping run > > > > source: Puppet > > > > tags: > > > > - err > > > > time: 2011-04-26 09:39:55.928687 +02:00 > > > > metrics: {} > > > > puppet_version: 2.6.6 > > > > report_format: 2 > > > > resource_statuses: {} > > > > status: failed > > > > time: 2011-04-26 09 > > > > > > > > and the files nagios_*.cfg don''t appear in my Nagios config. > > > > > > > > Can somebody help me with this troubleshoot? > > > > > > > > Ref: > > > http://blog.gurski.org/index.php/2010/01/28/automatic-monitoring-with-puppet-and-nagios/ > > > > > > > > > > > > > -- > > > Cédric Jeanneret | System Administrator > > > 021 619 10 32 | Camptocamp SA > > > cedric.jeanneret@camptocamp.com | PSE-A / EPFL > > > > > > >-- 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.
Juan-Francisco Diez
2011-May-02 15:51 UTC
Re: [Puppet Users] Automating Nagios with Puppet
Hi all, Sorry to not reply earlier. All you mention work fine. The directory can be change using the target parameter. The path must be absolute. Thanks for all. Juan-FRancisco 2011/4/29 lluis <lluis@ingent.net>> Hi, > beware of this if you change default file locations: > > "You can purge Nagios resources using the resources type, but only in > the default file locations. This is an architectural limitation" > > on Debian I prefer to link /etc/nagios3/conf.d to /etc/nagios > > greetings, > Lluís > > El dt 26 de 04 de 2011 a les 12:44 +0200, en/na Cedric Jeanneret va > escriure: > > Hello again, > > > > Yes, of course you can change the directory. > > > > Check out the mentioned module, we put all the nagios stuff in > /etc/nagios.d directory, keeping clean a /etc/nagios3 directory. For what > I''ve seen, it seems to do exactly what you''re trying to do. > > > > For the basic: > > nagios accept different directories for its configuration, you have to > add them in your nagios.cfg file using the cfg_dir directive. This can be > done using either a simple file, a template or with augeas (not sure for the > latest point). > > > > Cheers, > > > > C. > > > > On Tue, 26 Apr 2011 11:48:32 +0200 > > Juan-Francisco Diez <mochu33@gmail.com> wrote: > > > > > OK, thenks for your help. I solved the trouble using the $hostname fact > in > > > front of services definitions. > > > > > > But I have another question about this: > > > > > > Is it possible to define the directory where the file are created in > the > > > nagios server? > > > > > > Now the files are stored in the /etc/nagios. > > > > > > > > > 2011/4/26 Cedric Jeanneret <cedric.jeanneret@camptocamp.com> > > > > > > > Hello, > > > > > > > > Maybe have a look at our nagios module: > > > > https://github.com/camptocamp/puppet-nagios > > > > > > > > Your problem is that resources with same name are exported from > multiple > > > > hosts, and that make puppet crash with duplicated definition (as it''s > > > > exported resources, the error message is different ;) ). > > > > You should name your nagios resources with the fqdn embedded so that > it > > > > will be really unique across the DB. > > > > > > > > Cheers, > > > > > > > > C. > > > > > > > > On Tue, 26 Apr 2011 01:29:03 -0700 (PDT) > > > > Fransua33 <mochu33@gmail.com> wrote: > > > > > > > > > Hi everyone, > > > > > > > > > > I''m trying to automate the nagios configuration of new host through > > > > > Puppet. For this I define a nagios module with the generic > > > > > configuration of my Nagios host definition. The module look like > > > > > this: > > > > > > > > > > class nagios { > > > > > $packagelist=["nagios"] > > > > > > > > > > package { $packagelist: > > > > > ensure => "installed" > > > > > } > > > > > > > > > > $servicelist=["nagios", "httpd"] > > > > > > > > > > service { $servicelist: > > > > > ensure => "running", > > > > > hasstatus => "true", > > > > > hasrestart => "true" > > > > > } > > > > > > > > > > # collect resources and populate /etc/nagios/nagios_*.cfg > > > > > Nagios_host <<| |>> > > > > > Nagios_service <<| |>> > > > > > Nagios_hostextinfo <<| |>> > > > > > > > > > > class target { > > > > > @@nagios_host { $fqdn: > > > > > ensure => "present", > > > > > use => > > > > "ingacceso_$operatingsystem-server", > > > > > alias => $hostname, > > > > > address => $ipaddress, > > > > > contacts => > > > > "farconada,henry,fsariego,jfdiez" > > > > > } > > > > > > > > > > @@nagios_hostextinfo { $fqdn: > > > > > ensure => "present", > > > > > icon_image_alt => $operatingsystem, > > > > > icon_image => "$operatingsystem.png" > > > > > } > > > > > > > > > > @@nagios_service { "Host - Carga CPU": > > > > > use => > "ingacceso_generic-service", > > > > > host_name => "$fqdn", > > > > > check_command => "check_nrpe!check_load" > > > > > } > > > > > > > > > > @@nagios_service { "Host - CPU": > > > > > use => "ingacceso_generic- > > > > > service", > > > > > host_name => "$fqdn", > > > > > check_command => "check_nrpe!check_cpu" > > > > > } > > > > > > > > > > @@nagios_service { "Host - Ping": > > > > > use => "ingacceso_generic- > > > > > service", > > > > > host_name => "$fqdn", > > > > > check_command => "check_ping!400.0,20%! > > > > > 900.0,60%" > > > > > } > > > > > > > > > > @@nagios_service { "Host - /": > > > > > use => "ingacceso_generic- > > > > > service", > > > > > host_name => "$fqdn", > > > > > check_command => "check_nrpe!check_raiz" > > > > > } > > > > > > > > > > @@nagios_service { "Host - /boot": > > > > > use => "ingacceso_generic- > > > > > service", > > > > > host_name => "$fqdn", > > > > > check_command => "check_nrpe!check_boot" > > > > > } > > > > > > > > > > @@nagios_service { "Host - Memoria": > > > > > use => "ingacceso_generic- > > > > > service", > > > > > host_name => "$fqdn", > > > > > check_command => > "check_nrpe!check_memoria" > > > > > } > > > > > > > > > > @@nagios_service { "Host - Swap": > > > > > use => "ingacceso_generic- > > > > > service", > > > > > host_name => "$fqdn", > > > > > check_command => "check_nrpe!check_swap" > > > > > } > > > > > > > > > > @@nagios_service { "Host - Numero Procesos": > > > > > use => "ingacceso_generic- > > > > > service", > > > > > host_name => "$fqdn", > > > > > check_command => "check_nrpe! > > > > > check_total_procs" > > > > > } > > > > > > > > > > > > > > > @@nagios_service { "Host - Interfaces de Red": > > > > > use => "ingacceso_generic- > > > > > service", > > > > > host_name => "$fqdn", > > > > > check_command => "check_nrpe! > > > > > check_interfaces_net" > > > > > } > > > > > } > > > > > } > > > > > > > > > > After this, I include this module in the template.pp: > > > > > > > > > > node basenode { > > > > > case $operatingsystem { > > > > > centos: { include centos } > > > > > default: { include centos } > > > > > } > > > > > include baseapps, sshd, administradores, nagiosclient > > > > > include nagios::target > > > > > } > > > > > node default inherits basenode {} > > > > > node webserver inherits basenode { > > > > > include apache > > > > > } > > > > > node dbserver inherits basenode { > > > > > include mysql > > > > > } > > > > > node mailserver inherits basenode { > > > > > include postfix > > > > > } > > > > > node nagiosserver { > > > > > case $operatingsystem { > > > > > centos: { include centos } > > > > > default: { include centos } > > > > > } > > > > > include baseapps, sshd, administradores, nagiosclient > > > > > include nagios > > > > > } > > > > > > > > > > Also I define my nodes in the node.pp file: > > > > > > > > > > node ''masterpuppet.example.int'' inherits basenode {} > > > > > node ''web.example.int'' inherits webserver { > > > > > apache::virtual_host { "test1.example.int": > > > > > ip => "172.16.73.201" > > > > > } > > > > > apache::virtual_host { "test2.example.int": > > > > > ip => "172.16.73.201" > > > > > } > > > > > } > > > > > node ''db.example.int'' inherits dbserver {} > > > > > node ''mail.example.int'' inherits mailserver {} > > > > > node ''nagios.example.int'' inherits nagiosserver {} > > > > > > > > > > I verified that my store configs work well in my MySQL Database but > in > > > > > the reports of my Nagios host I can see this error: > > > > > > > > > > --- !ruby/object:Puppet::Transaction::Report > > > > > configuration_version: > > > > > host: nagios.example.int > > > > > kind: apply > > > > > logs: > > > > > - !ruby/object:Puppet::Util::Log > > > > > level: !ruby/sym err > > > > > message: "Could not retrieve catalog from remote server: > Error > > > > > 400 on SERVER: Exported resource Nagios_service[Host - /] cannot > > > > > override local resource on node nagios.example.int" > > > > > source: Puppet > > > > > tags: > > > > > - err > > > > > time: 2011-04-26 09:39:55.848399 +02:00 > > > > > - !ruby/object:Puppet::Util::Log > > > > > level: !ruby/sym notice > > > > > message: Using cached catalog > > > > > source: Puppet > > > > > tags: > > > > > - notice > > > > > time: 2011-04-26 09:39:55.928445 +02:00 > > > > > - !ruby/object:Puppet::Util::Log > > > > > level: !ruby/sym err > > > > > message: Could not retrieve catalog; skipping run > > > > > source: Puppet > > > > > tags: > > > > > - err > > > > > time: 2011-04-26 09:39:55.928687 +02:00 > > > > > metrics: {} > > > > > puppet_version: 2.6.6 > > > > > report_format: 2 > > > > > resource_statuses: {} > > > > > status: failed > > > > > time: 2011-04-26 09 > > > > > > > > > > and the files nagios_*.cfg don''t appear in my Nagios config. > > > > > > > > > > Can somebody help me with this troubleshoot? > > > > > > > > > > Ref: > > > > > http://blog.gurski.org/index.php/2010/01/28/automatic-monitoring-with-puppet-and-nagios/ > > > > > > > > > > > > > > > > > -- > > > > Cédric Jeanneret | System Administrator > > > > 021 619 10 32 | Camptocamp SA > > > > cedric.jeanneret@camptocamp.com | PSE-A / EPFL > > > > > > > > > > > > > > -- > 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.