From 5df607a33d87ba8ab86a4116669ed2bc61c7131c Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Wed, 13 Jul 2011 19:53:37 -0300 Subject: Debian doesn't need explicit check_smtp definition This plugin is already defined at nagios-plugins, so removing it for the same reason as e7f85f647e6f641bd85fbdfdb26982350f782370. --- manifests/command/smtp.pp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'manifests/command/smtp.pp') diff --git a/manifests/command/smtp.pp b/manifests/command/smtp.pp index 04f8543..5cb777e 100644 --- a/manifests/command/smtp.pp +++ b/manifests/command/smtp.pp @@ -1,7 +1,11 @@ class nagios::command::smtp { nagios_command{ 'check_smtp': - command_line => '$USER1$/check_smtp -H $ARG1$ -p $ARG2$'; + command_line => '$USER1$/check_smtp -H $ARG1$ -p $ARG2$', + ensure => $operatingsystem ? { + debian,ubuntu => absent, + default => present, + }; 'check_smtp_tls': command_line => '$USER1$/check_smtp -H $ARG1$ -p $ARG2$ -S'; 'check_smtp_cert': -- cgit v1.2.3 From 86a6c028e16a09cdbc2458c117b405898c885688 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Wed, 13 Jul 2011 20:03:04 -0300 Subject: Debian doesn't need explicit check_smtp definition (2) This plugin is already defined at nagios-plugins, so removing it for the same reason as e7f85f647e6f641bd85fbdfdb26982350f782370. This commit has more readable implementation than the previous. --- manifests/command/smtp.pp | 42 +++++++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 15 deletions(-) (limited to 'manifests/command/smtp.pp') diff --git a/manifests/command/smtp.pp b/manifests/command/smtp.pp index 5cb777e..e4df505 100644 --- a/manifests/command/smtp.pp +++ b/manifests/command/smtp.pp @@ -1,18 +1,30 @@ class nagios::command::smtp { - nagios_command{ - 'check_smtp': - command_line => '$USER1$/check_smtp -H $ARG1$ -p $ARG2$', - ensure => $operatingsystem ? { - debian,ubuntu => absent, - default => present, - }; - 'check_smtp_tls': - command_line => '$USER1$/check_smtp -H $ARG1$ -p $ARG2$ -S'; - 'check_smtp_cert': - command_line => '$USER1$/check_smtp -H $ARG1$ -p $ARG2$ -S -D $ARG3$'; - 'check_ssmtp': - command_line => '$USER1$/check_ssmtp -H $ARG1$ -p $ARG2$ -S'; - 'check_ssmtp_cert': - command_line => '$USER1$/check_ssmtp -H $ARG1$ -p $ARG2$ -S -D $ARG3$'; + case $operatingsystem { + debian,ubuntu: { + nagios_command{ + 'check_smtp_tls': + command_line => '$USER1$/check_smtp -H $ARG1$ -p $ARG2$ -S'; + 'check_smtp_cert': + command_line => '$USER1$/check_smtp -H $ARG1$ -p $ARG2$ -S -D $ARG3$'; + 'check_ssmtp': + command_line => '$USER1$/check_ssmtp -H $ARG1$ -p $ARG2$ -S'; + 'check_ssmtp_cert': + command_line => '$USER1$/check_ssmtp -H $ARG1$ -p $ARG2$ -S -D $ARG3$'; + } + } + default: { + nagios_command{ + 'check_smtp': + command_line => '$USER1$/check_smtp -H $ARG1$ -p $ARG2$'; + 'check_smtp_tls': + command_line => '$USER1$/check_smtp -H $ARG1$ -p $ARG2$ -S'; + 'check_smtp_cert': + command_line => '$USER1$/check_smtp -H $ARG1$ -p $ARG2$ -S -D $ARG3$'; + 'check_ssmtp': + command_line => '$USER1$/check_ssmtp -H $ARG1$ -p $ARG2$ -S'; + 'check_ssmtp_cert': + command_line => '$USER1$/check_ssmtp -H $ARG1$ -p $ARG2$ -S -D $ARG3$'; + } + } } } -- cgit v1.2.3 From 4c16852f285db60ff0006326e8bed11a2384d74f Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Wed, 13 Jul 2011 20:12:10 -0300 Subject: Do not define check_ssmtp on debian --- manifests/command/smtp.pp | 2 -- 1 file changed, 2 deletions(-) (limited to 'manifests/command/smtp.pp') diff --git a/manifests/command/smtp.pp b/manifests/command/smtp.pp index e4df505..f320f1c 100644 --- a/manifests/command/smtp.pp +++ b/manifests/command/smtp.pp @@ -6,8 +6,6 @@ class nagios::command::smtp { command_line => '$USER1$/check_smtp -H $ARG1$ -p $ARG2$ -S'; 'check_smtp_cert': command_line => '$USER1$/check_smtp -H $ARG1$ -p $ARG2$ -S -D $ARG3$'; - 'check_ssmtp': - command_line => '$USER1$/check_ssmtp -H $ARG1$ -p $ARG2$ -S'; 'check_ssmtp_cert': command_line => '$USER1$/check_ssmtp -H $ARG1$ -p $ARG2$ -S -D $ARG3$'; } -- cgit v1.2.3 From 55ac508405e87bdab99ac0cbe0eacac28a8f60b8 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Wed, 13 Jul 2011 20:19:48 -0300 Subject: Minor style change --- manifests/command/smtp.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'manifests/command/smtp.pp') diff --git a/manifests/command/smtp.pp b/manifests/command/smtp.pp index f320f1c..a887e0a 100644 --- a/manifests/command/smtp.pp +++ b/manifests/command/smtp.pp @@ -1,7 +1,7 @@ class nagios::command::smtp { case $operatingsystem { debian,ubuntu: { - nagios_command{ + nagios_command { 'check_smtp_tls': command_line => '$USER1$/check_smtp -H $ARG1$ -p $ARG2$ -S'; 'check_smtp_cert': @@ -11,7 +11,7 @@ class nagios::command::smtp { } } default: { - nagios_command{ + nagios_command { 'check_smtp': command_line => '$USER1$/check_smtp -H $ARG1$ -p $ARG2$'; 'check_smtp_tls': -- cgit v1.2.3 From 69b346b34c981b91e068222b15a8a825f08344c2 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 14 Jul 2011 13:05:08 -0300 Subject: Branching the definition for smtp, imap and pop3 commands --- manifests/command/smtp.pp | 40 +++++++++++++++++----------------------- 1 file changed, 17 insertions(+), 23 deletions(-) (limited to 'manifests/command/smtp.pp') diff --git a/manifests/command/smtp.pp b/manifests/command/smtp.pp index a887e0a..29d97f8 100644 --- a/manifests/command/smtp.pp +++ b/manifests/command/smtp.pp @@ -1,28 +1,22 @@ class nagios::command::smtp { case $operatingsystem { - debian,ubuntu: { - nagios_command { - 'check_smtp_tls': - command_line => '$USER1$/check_smtp -H $ARG1$ -p $ARG2$ -S'; - 'check_smtp_cert': - command_line => '$USER1$/check_smtp -H $ARG1$ -p $ARG2$ -S -D $ARG3$'; - 'check_ssmtp_cert': - command_line => '$USER1$/check_ssmtp -H $ARG1$ -p $ARG2$ -S -D $ARG3$'; - } - } - default: { - nagios_command { - 'check_smtp': - command_line => '$USER1$/check_smtp -H $ARG1$ -p $ARG2$'; - 'check_smtp_tls': - command_line => '$USER1$/check_smtp -H $ARG1$ -p $ARG2$ -S'; - 'check_smtp_cert': - command_line => '$USER1$/check_smtp -H $ARG1$ -p $ARG2$ -S -D $ARG3$'; - 'check_ssmtp': - command_line => '$USER1$/check_ssmtp -H $ARG1$ -p $ARG2$ -S'; - 'check_ssmtp_cert': - command_line => '$USER1$/check_ssmtp -H $ARG1$ -p $ARG2$ -S -D $ARG3$'; - } + debian,ubuntu: { } # Debian/Ubuntu already define those checks + default: { + nagios_command { + 'check_smtp': + command_line => '$USER1$/check_smtp -H $ARG1$ -p $ARG2$'; + 'check_ssmtp': + command_line => '$USER1$/check_ssmtp -H $ARG1$ -p $ARG2$ -S'; } + } + } + + nagios_command { + 'check_smtp_tls': + command_line => '$USER1$/check_smtp -H $ARG1$ -p $ARG2$ -S'; + 'check_smtp_cert': + command_line => '$USER1$/check_smtp -H $ARG1$ -p $ARG2$ -S -D $ARG3$'; + 'check_ssmtp_cert': + command_line => '$USER1$/check_ssmtp -H $ARG1$ -p $ARG2$ -S -D $ARG3$'; } } -- cgit v1.2.3