nagios: Add service dependencies for service certificate checks
This commit is contained in:
parent
45ad1a4a65
commit
1c39964c17
2 changed files with 48 additions and 14 deletions
|
@ -609,6 +609,7 @@ define nagios::host($address=undef, $group="NONE", $osname="NONE",
|
|||
# Hostgroup name.
|
||||
#
|
||||
define nagios::service($host, $command, $description, $group="NONE",
|
||||
$depended_host=undef, $depended_service=undef,
|
||||
$confdir=$nagios::common::confdir) {
|
||||
|
||||
file { "${confdir}/service_${name}.cfg":
|
||||
|
@ -649,6 +650,25 @@ define nagios::service($host, $command, $description, $group="NONE",
|
|||
servicegroups => $group,
|
||||
}
|
||||
}
|
||||
if $depended_host and $depended_service {
|
||||
file { "${confdir}/service_dependency_${name}.cfg":
|
||||
ensure => present,
|
||||
mode => "0640",
|
||||
owner => "root",
|
||||
group => "nagios",
|
||||
before => Nagios_servicedependency[$name],
|
||||
require => File["/etc/nagios/conf.d"],
|
||||
}
|
||||
nagios_servicedependency { $name:
|
||||
dependent_host_name => $host,
|
||||
dependent_service_description => $description,
|
||||
host_name => $depended_host,
|
||||
service_description => $depended_service,
|
||||
execution_failure_criteria => 'c,p',
|
||||
target => "${confdir}/service_dependency_${name}.cfg",
|
||||
notify => Service["nagios"],
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue