I have a little problem when I try to integrate Puppet with Nagios.
This is my configuration (I know, it's so simple but it's my first try)
/etc/puppet/modules/nagios/manifests/init.pp
class nagios::server {
package { ["nagios"]:
ensure => installed,
}
service { nagios:
ensure => running,
enable => true,
}
file { 'resource-d':
path => '/etc/nagios/objects',
ensure => directory,
owner => 'nagios',
}
# Collect the nagios_host resources
Nagios_host <<||>> {
require => File[resource-d],
notify => [Service[nagios]],
}
}
/etc/puppet/modules/nagios/manifests/export.pp
class nagios::export {
@@nagios_host { $::fqdn:
address => $::ipaddress,
check_command => 'check-host-alive!3000.0,80%!5000.0,100%!10',
hostgroups => 'all-servers',
target => "/etc/nagios/objects/host_${::fqdn}.cfg"
}
}
/etc/puppet/manifests/site.pp
node 'server-1'
{
include nagios::server
include nagios::export
}
All this stuff is working but the cfgs with Nagios configuration are created in the remote node "server-1" instead of Nagios server (Nagios and Puppet are running in the same server) and I cannot get this configuration from server-1 to be shown in Nagios server. Do you have any idea of what is happening?.
Regards