diff options
author | mh <mh@immerda.ch> | 2015-10-31 10:26:05 +0100 |
---|---|---|
committer | mh <mh@immerda.ch> | 2015-10-31 10:26:05 +0100 |
commit | c3ca4ac25d7cdfd5826149445f2946d64d968f97 (patch) | |
tree | 94f4375d9f1cb33e870ab77ab21b243ee364dbe6 /manifests | |
parent | 2c4f69e1ea1656edf7c7d39fa90d200f901404df (diff) |
also add pop3 login checks
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/command/imap_pop3.pp | 4 | ||||
-rw-r--r-- | manifests/plugins/imap_login.pp | 7 | ||||
-rw-r--r-- | manifests/plugins/mail_login.pp | 10 | ||||
-rw-r--r-- | manifests/service/pop3_login.pp | 22 |
4 files changed, 35 insertions, 8 deletions
diff --git a/manifests/command/imap_pop3.pp b/manifests/command/imap_pop3.pp index 632b304..42e4092 100644 --- a/manifests/command/imap_pop3.pp +++ b/manifests/command/imap_pop3.pp @@ -1,6 +1,6 @@ # manage mail checks class nagios::command::imap_pop3 { - require ::nagios::plugins::imap_login + require ::nagios::plugins::mail_login case $::operatingsystem { 'Debian','Ubuntu': { } # Debian/Ubuntu already define those checks default: { @@ -24,5 +24,7 @@ class nagios::command::imap_pop3 { command_line => '$USER1$/check_tcp -H $ARG1$ -p 2000'; 'check_imap_login': command_line => '$USER1$/check_imap_login -s -H $ARG1$ -u $ARG2$ -p $ARG3$ -w $ARG4$ -c $ARG5$'; + 'check_pop3_login': + command_line => '$USER1$/check_pop3_login -s -H $ARG1$ -u $ARG2$ -p $ARG3$ -w $ARG4$ -c $ARG5$'; } } diff --git a/manifests/plugins/imap_login.pp b/manifests/plugins/imap_login.pp deleted file mode 100644 index bb53b81..0000000 --- a/manifests/plugins/imap_login.pp +++ /dev/null @@ -1,7 +0,0 @@ -# a simple imap login check -class nagios::plugins::imap_login { - nagios::plugin { 'check_imap_login': - source => 'nagios/plugins/check_imap_login', - } -} - diff --git a/manifests/plugins/mail_login.pp b/manifests/plugins/mail_login.pp new file mode 100644 index 0000000..a86cdc2 --- /dev/null +++ b/manifests/plugins/mail_login.pp @@ -0,0 +1,10 @@ +# simple mail login check +class nagios::plugins::mail_login { + nagios::plugin { + 'check_imap_login': + source => 'nagios/plugins/check_imap_login'; + 'check_pop3_login': + source => 'nagios/plugins/check_pop3_login'; + } +} + diff --git a/manifests/service/pop3_login.pp b/manifests/service/pop3_login.pp new file mode 100644 index 0000000..7453528 --- /dev/null +++ b/manifests/service/pop3_login.pp @@ -0,0 +1,22 @@ +# a pop3 login check +define nagios::service::pop3_login( + $username, + $password, + $warning = 5, + $critical = 10, + $host = $::fqdn, + $host_name = $::fqdn, + $ensure = 'present', +){ + nagios::service{ + "pop3_login_${name}": + ensure => $ensure; + } + + if $ensure != 'absent' { + Nagios::Service["pop3_login_${name}"]{ + check_command => "check_pop3_login!${host}!${username}!${password}!${warning}!${critical}", + host_name => $host_name, + } + } +} |