Module: check_mk
Branch: master
Commit: 14e94e8ac134cb65201399ac4bdf533035cf12c5
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=14e94e8ac134cb…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Jun 22 13:47:09 2017 +0200
4897 FIX check_bi_aggr: Fixed URL in error messages in case of exceptions during checking
Change-Id: I97f2f5fd692d6e877ba80f2c7d47958c5611698a
---
.werks/4897 | 11 +++++++++++
active_checks/check_bi_aggr | 7 ++++---
2 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/.werks/4897 b/.werks/4897
new file mode 100644
index 0000000..fe0128e
--- /dev/null
+++ b/.werks/4897
@@ -0,0 +1,11 @@
+Title: check_bi_aggr: Fixed URL in error messages in case of exceptions during checking
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1498131993
+
+
diff --git a/active_checks/check_bi_aggr b/active_checks/check_bi_aggr
index 07edef6..1657cca 100755
--- a/active_checks/check_bi_aggr
+++ b/active_checks/check_bi_aggr
@@ -25,6 +25,7 @@
# Boston, MA 02110-1301 USA.
import sys, getopt, requests, traceback
+import urllib
import os
import time
@@ -161,7 +162,7 @@ def init_auth():
url = "%s/check_mk/view.py" \
"?view_name=aggr_single_api" \
"&aggr_name=%s&output_format=python" % \
- (base_url.rstrip('/'), aggr_name)
+ (base_url.rstrip('/'), urllib.quote(aggr_name))
auth = None
if auth_mode in ['basic', 'digest', 'kerberos']:
@@ -184,8 +185,8 @@ except requests.URLRequired, e:
sys.stdout.write("UNKNOWN: %s\n" % e)
sys.exit(3)
except Exception, e:
- sys.stdout.write('ERROR: Exception while opening URL (%s): %s\n' %
- (url, traceback.format_exc()))
+ sys.stdout.write('ERROR: Exception while opening URL: %s - %s\n%s' %
+ (url, e, traceback.format_exc()))
sys.exit(3)
try: