Defined Type: omd::client::checks::cert
- Defined in:
- manifests/client/checks/cert.pp
Overview
Class: omd::client::checks::cert
This class installs a ssl cert check over MRPE.
Check script from: <github.com/ripienaar/monitoring-scripts>
Parameters
- title/name
-
Resource name for MRPE “Cert_$title/$name”.
- path
-
Path to certificate file, whereas $title is used for resource description. defaults to _$title/$name_
- warn
-
Warn level in seconds defaults to 2592000 (30 days)
- crit
-
Critical level in seconds defaults to 604800 (7 days)
- options
-
Further options of check (see –help) defaults to _”_
Examples
include omd::client::checks::cert
Authors
Frederik Wagner <wagner@wagit.de>
Copyright
Copyright 2014 Frederik Wagner
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'manifests/client/checks/cert.pp', line 40
define omd::client::checks::cert (
$warn = '2592000',
$crit = '604800',
$path = $name,
$options = '',
) {
validate_re($warn, '^\d+$')
validate_re($crit, '^\d+$')
validate_absolute_path($path)
validate_string($options)
include 'omd::client::checks'
$name_repl = regsubst($name, '[/\s]', '_', 'G')
$plugin_path = $omd::client::checks::params::plugin_path
$content = "Cert_${name_repl}\t${plugin_path}/nagios/plugins/check_cert.rb -w ${warn} -c ${crit} --cert ${path} ${options}\n"
concat::fragment { "check_cert_${name_repl}":
target => $omd::client::checks::params::mrpe_config,
content => $content,
order => '50',
require => File['check_cert'],
}
# reinventorize trigger if a MRPE check changed
@@file { "${::puppet_vardir}/omd/check_cert_${name_repl}_${::fqdn}":
ensure => present,
owner => root,
group => root,
mode => '0644',
content => $content,
backup => false,
# server collection and site inventory trigger tags
tag => ['omd_client_checks', "omd_client_check_${::fqdn}"],
}
}
|