Module: check_mk
Branch: master
Commit: 6284d183cc70554802529ccaa5717430a02e8cf8
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6284d183cc7055…
Author: Marcel Arentz <ma(a)mathias-kettner.de>
Date: Tue Jan 23 12:17:08 2018 +0100
5556 check_bi_aggr: Active Check for BI is now able to use the password store
Change-Id: I3a4f052643e9ce65cc1c4e273a03c9a035cbb692
---
.werks/5556 | 10 ++++++++++
active_checks/check_bi_aggr | 2 ++
checks/check_bi_aggr | 21 +++++++++++----------
web/plugins/wato/active_checks.py | 2 +-
4 files changed, 24 insertions(+), 11 deletions(-)
diff --git a/.werks/5556 b/.werks/5556
new file mode 100644
index 0000000..10f7ccb
--- /dev/null
+++ b/.werks/5556
@@ -0,0 +1,10 @@
+Title: check_bi_aggr: Active Check for BI is now able to use the password store
+Level: 2
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.5.0i3
+Date: 1516706180
+Class: feature
+
+
diff --git a/active_checks/check_bi_aggr b/active_checks/check_bi_aggr
index 1657cca..5f67ee0 100755
--- a/active_checks/check_bi_aggr
+++ b/active_checks/check_bi_aggr
@@ -29,6 +29,8 @@ import urllib
import os
import time
+import cmk.password_store
+cmk.password_store.replace_passwords()
# tell requests not to honour "http(s)_proxy" env variables
proxies = {
diff --git a/checks/check_bi_aggr b/checks/check_bi_aggr
index 130ac78..94664c8 100644
--- a/checks/check_bi_aggr
+++ b/checks/check_bi_aggr
@@ -26,27 +26,28 @@
def check_bi_aggr_arguments(params):
base_url, aggr_name, username, secret, opt_params = params
- args = ''
+ args = []
- args += ' -b %s' % quote_shell_string(base_url)
- args += ' -a %s' % quote_shell_string(aggr_name)
- args += ' -u %s' % quote_shell_string(username)
- args += ' -s %s' % quote_shell_string(secret)
+ args += [ '-b%s' % base_url ]
+ args += [ '-a%s' % aggr_name ]
+ args += [ '-u%s' % username ]
+ args += [ passwordstore_get_cmdline("-s%s", secret) ]
if "auth_mode" in opt_params:
- args += ' -m %s' % quote_shell_string(opt_params['auth_mode'])
+ args += [ '-m%s' % opt_params['auth_mode'] ]
if "timeout" in opt_params:
- args += ' -t %d' % opt_params['timeout']
+ args += [ '-t%d' % opt_params['timeout'] ]
if opt_params.get("in_downtime"):
- args += ' --in-downtime %s' % opt_params['in_downtime']
+ args += [ '--in-downtime=%s' % opt_params['in_downtime'] ]
if opt_params.get("acknowledged"):
- args += ' --acknowledged %s' % opt_params['acknowledged']
+ args += [ '--acknowledged=%s' % opt_params['acknowledged'] ]
if opt_params.get("track_downtimes"):
- args += " -r -n '$HOSTNAME$'"
+ args += [ '-r' ]
+ args += [ '-n $HOSTNAME$' ]
return args
diff --git a/web/plugins/wato/active_checks.py b/web/plugins/wato/active_checks.py
index 698099c..acbc909 100644
--- a/web/plugins/wato/active_checks.py
+++ b/web/plugins/wato/active_checks.py
@@ -1666,7 +1666,7 @@ register_rule(group,
"authentication is set to \"Automation Secret\"
based authentication."),
allow_empty = False
),
- Password(
+ IndividualOrStoredPassword(
title = _("Password / Secret"),
help = _("Valid automation secret or password for the user,
depending on the chosen "
"authentication mode. Be aware that this mode has to be
enabled on the monitoring instance. " "Otherwise
authentication will fail."),