Hello,
i 'm try automatizando my nagios monitoring i've running puppet with 
puppetDB and postgres and this running ok.  The problem that present in 
this moment is the nagios structure in the server with generate puppet for 
example:
When I connect my node agent (puppet agent --test) and my nagios server 
after run (puppet agent --test) generate the archives:

/etc/nagios/nagios_host.cfg ---> (host definition) 

[..............]
# HEADER: This file was autogenerated at Fri Aug 30 17:06:55 -0400 2013
# HEADER: by puppet.  While it can still be managed manually, it
# HEADER: is definitely not recommended.
define host {
address                        10.0.0.133
use                            linux-server
host_name                      node5.example.com
alias                          node5
}
[..............]

resource.d/host_node1.example.com.cfg (service monitoring)

[..............]
# HEADER: This file was autogenerated at Fri Aug 30 17:06:54 -0400 2013
# HEADER: by puppet.  While it can still be managed manually, it
# HEADER: is definitely not recommended.

define service {
## --PUPPET_NAME-- (called '_naginator_name' in the manifest)               
 check_users_node1
use                            generic-service
service_description            node1_check_users
host_name                      node1.example.com
check_command                  check_nrpe!check_users
}
[..............]

But when the service nagios is restarted say error message 

[..............]
Error: Could not find any host matching 'node1.example.com' (config file 
'/etc/nagios/resource.d/host_node1.example.com.cfg', starting on line 4)
Error: Could not expand hostgroups and/or hosts specified in service 
(config file '/etc/nagios/resource.d/host_node5.example.com.cfg', starting 
on line 4)
[..............]

And the "solution" is placed (manually) the host definition 
"/etc/nagios/nagios_host.cfg" within "resource.d/host_node1.example.com.cfg" 
. For example: 

[..............]
[root@nagios nagios]# cat resource.d/host_node5.example.com.cfg
# HEADER: This file was autogenerated at Fri Aug 30 17:06:54 -0400 2013
# HEADER: by puppet.  While it can still be managed manually, it
# HEADER: is definitely not recommended.

define host {
        address                        10.0.0.133
        use                            linux-server
        host_name                      node5.example.com
        alias                          node5
}

define service {
## --PUPPET_NAME-- (called '_naginator_name' in the manifest)               
 check_users_node5
use                            generic-service
service_description            node5_check_users
host_name                      node5.example.com
check_command                  check_nrpe!check_users
}
[..............]

My export class is (node information) is:

[..............]
class nagios::export {

  @@nagios_host { $::fqdn:
    ensure  => present,
    alias   => $::hostname,
    address => $::ipaddress,
    use     => "linux-server",
    notify  => Service["nagios"],
  }

  @@nagios_service { "check_users_${hostname}":
#       check_command       => "check_ping!100.0,20%!500.0,60%",
        check_command       => "check_nrpe!check_users",
        use                 => "generic-service",
        host_name           => "$fqdn",
        service_description => "${hostname}_check_users",
        target              => "/etc/nagios/resource.d/host_${::fqdn}.cfg",
 }
}
[..............]

¿How to make the definition is within the same resource? ¿is possible? or 
¿What is the way to correct the problem?


Thanks.!!


-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to