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') 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