Module: check_mk
Branch: master
Commit: 8a8575461f1bd2fab24520899e653e737b55abd1
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8a8575461f1bd2…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Jul 27 13:27:48 2016 +0200
check_mail_loop now supports using passwords from store
---
checks/check_mail_loop | 44 ++++++++++++++++++++++----------------------
1 file changed, 22 insertions(+), 22 deletions(-)
diff --git a/checks/check_mail_loop b/checks/check_mail_loop
index bd7ba6a..6121d49 100644
--- a/checks/check_mail_loop
+++ b/checks/check_mail_loop
@@ -25,57 +25,57 @@
# Boston, MA 02110-1301 USA.
def check_mail_loop_arguments(params):
- args = ''
+ args = []
if 'smtp_server' in params:
- args += ' --smtp-server=%s' %
quote_shell_string(params['smtp_server'])
+ args += [ '--smtp-server=%s' % params['smtp_server'] ]
else:
- args += ' --smtp-server=$HOSTADDRESS$'
+ args += [ '--smtp-server=$HOSTADDRESS$' ]
if 'imap_tls' in params:
- args += ' --imap-tls'
+ args += [ '--imap-tls' ]
if 'smtp_tls' in params:
- args += ' --smtp-tls'
+ args += [ '--smtp-tls' ]
if 'smtp_port' in params:
- args += ' --smtp-port=%d' % params['smtp_port']
+ args += [ '--smtp-port=%d' % params['smtp_port'] ]
if 'smtp_auth' in params:
- args += ' --smtp-username=%s' %
quote_shell_string(params['smtp_auth'][0])
- args += passwordstore_get_cmdline(" --smtp-password=%s",
params['smtp_auth'][1])
+ args += [ '--smtp-username=%s' % params['smtp_auth'][0] ]
+ args += [ passwordstore_get_cmdline("--smtp-password=%s",
params['smtp_auth'][1]) ]
fetch_proto, fetch_params = params['fetch']
- args += ' --fetch-protocol=%s' % quote_shell_string(fetch_proto)
+ args += [ '--fetch-protocol=%s' % fetch_proto ]
if 'server' in fetch_params:
- args += ' --fetch-server=%s' %
quote_shell_string(fetch_params['server'])
+ args += [ '--fetch-server=%s' % fetch_params['server'] ]
else:
- args += ' --fetch-server=$HOSTADDRESS$'
+ args += [ '--fetch-server=$HOSTADDRESS$' ]
fetch_use_ssl, fetch_port = fetch_params['ssl']
if fetch_use_ssl:
- args += ' --fetch-ssl'
+ args += [ '--fetch-ssl' ]
if fetch_port != None:
- args += ' --fetch-port=%d' % fetch_port
+ args += [ '--fetch-port=%d' % fetch_port ]
- args += ' --fetch-username=%s' %
quote_shell_string(fetch_params['auth'][0])
- args += passwordstore_get_cmdline(" --fetch-password=%s",
fetch_params['auth'][1])
+ args += [ '--fetch-username=%s' % fetch_params['auth'][0] ]
+ args += [ passwordstore_get_cmdline("--fetch-password=%s",
fetch_params['auth'][1]) ]
- args += ' --mail-from=%s' % quote_shell_string(params['mail_from'])
- args += ' --mail-to=%s' % quote_shell_string(params['mail_to'])
+ args += [ '--mail-from=%s' % params['mail_from'] ]
+ args += [ '--mail-to=%s' % params['mail_to'] ]
if 'connect_timeout' in params:
- args += ' --connect-timeout=%d' % params['connect_timeout']
+ args += [ '--connect-timeout=%d' % params['connect_timeout'] ]
if 'delete_messages' in params:
- args += ' --delete-messages'
+ args += [ '--delete-messages' ]
- args += ' --status-suffix=%s' % quote_shell_string(g_hostname + '-' +
params['item'])
+ args += [ '--status-suffix=%s' % (g_hostname + '-' +
params['item']) ]
if 'duration' in params:
- args += ' --warning=%d' % params['duration'][0]
- args += ' --critical=%d' % params['duration'][1]
+ args += [ '--warning=%d' % params['duration'][0] ]
+ args += [ '--critical=%d' % params['duration'][1] ]
return args