Nagios is restarted every time a host or service is added, but never when
removing hosts or services.
The client resources:
@@nagios_host { "$::fqdn":
ensure => 'present',
alias => "$::hostname",
address => "$::ipaddress",
use => 'linux-server',
}
@@nagios_service { "check_ssh_${::hostname}":
check_command => 'check_ssh',
use => 'generic-service',
host_name => "$::fqdn",
service_description => 'SSH',
}
The nagios server resources:
service { 'nagios':
ensure => 'running',
hasstatus => true,
enable => true,
}
resources { [ "nagios_host", "nagios_service" ]:
purge => true,
}
Nagios_host <<||>> { notify => Service['nagios'] }
Nagios_service <<||>> { notify => Service['nagios'] }
Based on variations I have seen out there I have also tried the following:
- Have the service subscribe to /etc/nagios with checksum=>mtime
- Added before => File['/etc/nagios'], to Nagios_host and Nagios_service
- Tried checksum=>mtime on /etc/nagios/nagios_*.cfg resources
When I add a host and then run puppet agent --test on the nagios server I
see this:
notice: /Stage[main]/Nagios::Monitor/Nagios_host[test1.tld]/ensure: created
notice:
/Stage[main]/Nagios::Monitor/Nagios_service[check_ssh_test1]/ensure: created
notice: /Stage[main]/Nagios::Monitor/Service[nagios]: Triggered 'refresh'
from 2 events
When I remove the host from the database via
delete from fact_values where host_id='N';
delete from resources where host_id='N';
delete from hosts where id='N';
The next run of puppet on the nagios server produces:
notice: /Nagios_service[check_ssh_test1]/ensure: removed
notice: /Nagios_host[test1.tld]/ensure: removed
nagios_host.cfg and nagios_service.cfg are properly updated, but the
service will not restart.
This is centos6.3 with epel puppet-2.6.17 (for client and master). Any
ideas?
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.