diff options
Diffstat (limited to 'puppet/modules/nagios/manifests/service/ssmtp.pp')
m--------- | puppet/modules/nagios | 0 | ||||
-rw-r--r-- | puppet/modules/nagios/manifests/service/ssmtp.pp | 32 |
2 files changed, 32 insertions, 0 deletions
diff --git a/puppet/modules/nagios b/puppet/modules/nagios deleted file mode 160000 -Subproject 68dab01a85996e14efcccf856b623a2caf25782 diff --git a/puppet/modules/nagios/manifests/service/ssmtp.pp b/puppet/modules/nagios/manifests/service/ssmtp.pp new file mode 100644 index 00000000..b05678a6 --- /dev/null +++ b/puppet/modules/nagios/manifests/service/ssmtp.pp @@ -0,0 +1,32 @@ +define nagios::service::ssmtp( + $ensure = 'present', + $host = 'absent', + $port = '465', + $cert_days = 10 +){ + $real_host = $host ? { + 'absent' => $name, + default => $host + } + + 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}", + } + } + } +} |