diff options
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}", + } + } + } +} |