Module: check_mk
Branch: master
Commit: cb676ac4a81ac35c6dafd704b137b2db9700f7de
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=cb676ac4a81ac3…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Mon Mar 25 14:40:20 2019 +0100
FIX BI Special Agent: Fixed two issues preventing the agent to run at all
Fixed: Exception determining the credentials for the automation account.
Fixed: Web API interface get_bi_aggregations was unable to consider the filter key as
optional
CMK-1875
Change-Id: I0db02ae33bd5359694fc04e1f35e2fc360447ea7
---
agents/special/agent_bi | 4 +++-
cmk/gui/plugins/webapi/webapi.py | 1 +
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/agents/special/agent_bi b/agents/special/agent_bi
index e1ae2e9..d656ff9 100755
--- a/agents/special/agent_bi
+++ b/agents/special/agent_bi
@@ -136,7 +136,9 @@ class AggregationRawdataGenerator(object):
secret_file_path = Path(
cmk.utils.paths.var_dir) / "web" / self._username /
"automation.secret"
- self._secret = file(secret_file_path).read()
+
+ with secret_file_path.open(encoding="utf-8") as f:
+ self._secret = f.read()
else:
self._username, self._secret = self._credentials[1]
diff --git a/cmk/gui/plugins/webapi/webapi.py b/cmk/gui/plugins/webapi/webapi.py
index 1b47ab0..62f9ad8 100644
--- a/cmk/gui/plugins/webapi/webapi.py
+++ b/cmk/gui/plugins/webapi/webapi.py
@@ -1006,6 +1006,7 @@ class APICallBIAggregationState(APICallCollection):
return {
"get_bi_aggregations": {
"handler": self._get,
+ "optional_keys": ["filter"],
"required_permissions": required_permissions,
},
}