diff options
author | mh <mh@immerda.ch> | 2010-12-12 12:44:01 +0100 |
---|---|---|
committer | mh <mh@immerda.ch> | 2010-12-12 12:44:01 +0100 |
commit | c9c4f5bb895e98e31d84c751a7fcbdae9bf57008 (patch) | |
tree | 662c87ca89e1e7e3905d30160cfaaa13d985fc79 /manifests/service/ssmtp.pp | |
parent | 2214b80b579e68fcbe329b7a626944af0b3834ad (diff) |
add smtp checks
Diffstat (limited to 'manifests/service/ssmtp.pp')
-rw-r--r-- | manifests/service/ssmtp.pp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/manifests/service/ssmtp.pp b/manifests/service/ssmtp.pp new file mode 100644 index 0000000..2467fe0 --- /dev/null +++ b/manifests/service/ssmtp.pp @@ -0,0 +1,34 @@ +define nagios::service::ssmtp( + $ensure = 'present', + $host = 'absent', + $port = '465', + $cert_days = 10 +){ + $real_host = $host ? { + 'absent' => $name, + default => $host + } + + include nagios::command::smtp + + nagios::service{ + "ssmtp_${name}_${port}": + ensure => $ensure; + "ssmtp_cert_${name}_${port}": + ensure => $cert_days ? { + 'absent' => 'absent', + default => $ensure + }; + } + + if $ensure != 'absent' { + Nagios::Service["ssmtp_${name}_${port}"]{ + check_command => "check_ssmtp!${real_host}!${port}", + } + if $cert_days != 'absent' { + Nagios::Service["ssmtp_cert_${name}_${port}"]{ + check_command => "check_ssmtp_cert!${real_host}!${port}!${cert_days}", + } + } + } +} |