11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
# File 'manifests/command.pp', line 11
define nagios::command (
$command_line,
$ensure = present,
) {
include ::nagios::params
$fname = regsubst($name, '\W', '_', 'G')
nagios_command { $name:
ensure => $ensure,
command_line => $command_line,
target => "${nagios::params::resourcedir}/command-${fname}.cfg",
notify => Exec['nagios-restart'],
}
file { "${nagios::params::resourcedir}/command-${fname}.cfg":
ensure => $ensure,
owner => 'root',
mode => '0644',
before => Nagios_command[$name],
}
}
|