Defined Type: monit::checkurl
- Defined in:
- manifests/checkurl.pp
Overview
Define: monit::checkurl
Basic URL checking define
Usage: monit::checkurl { ‘hostname’:
fqdn => 'hostname.example42.com',
url => 'http://hostname.example42.com/check/something.php',
content => 'OKK',
failaction => 'exec /etc/restart.d/script.sh',
}
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'manifests/checkurl.pp', line 13
define monit::checkurl (
$fqdn = '',
$template = 'monit/checkurl.erb',
$url = '',
$content = '',
$failaction = 'alert',
$enable = true ) {
$ensure=bool2ensure($enable)
include monit
$real_fqdn = $fqdn ? {
'' => "${name}.${::domain}",
default => $fqdn,
}
$real_url = $url ? {
'' => "http://${real_fqdn}",
default => $url,
}
file { "Monitcheckurl_${name}":
ensure => $ensure,
path => "${monit::plugins_dir}/${name}",
mode => $monit::config_file_mode,
owner => $monit::config_file_owner,
group => $monit::config_file_group,
require => Package[$monit::package],
notify => $monit::manage_service_autorestart,
content => template($template),
replace => $monit::manage_file_replace,
}
}
|