diff options
-rw-r--r-- | manifests/init.pp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/manifests/init.pp b/manifests/init.pp index 542aa58..aebe102 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -3,6 +3,9 @@ class dovecot( $sqlite = false, $pgsql = false, $mysql = false, + $nagios_checks = { + 'hostname' => 'fqdn', + }, $munin_checks = true, $manage_shorewall = true ){ @@ -23,4 +26,22 @@ class dovecot( if $dovecot::munin_checks { include dovecot::munin } + + if $dovecot::nagios_checks { + if $dovecot::nagios_checks['hostname'] == 'fqdn' { + $host_to_check = $fqdn + } else { + $host_to_check = $dovecot::nagios_checks['hostname'] + } + nagios::service{ + "check_imap": + check_command => "check_imap!${host_to_check}!143"; + "check_imap_ssl": + check_command => "check_imap_ssl!${host_to_check}!993"; + "check_pop3": + check_command => "check_pop3!${host_to_check}!110"; + "check_pop3_ssl": + check_command => "check_pop3_ssl!${host_to_check}!995"; + } + } } |