Module: check_mk
Branch: master
Commit: 3d7c1f8dc4915eef6e33ee03eaaad929a7b54102
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3d7c1f8dc4915e…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Nov 25 11:58:02 2014 +0100
#1549 FIX bluecat_threads: do not inventorize this check where information is missing
This avoid UNKNOWN check results on devices where no thread information is
available.
---
.werks/1549 | 11 +++++++++++
ChangeLog | 1 +
checks/bluecat_threads | 3 ++-
3 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/.werks/1549 b/.werks/1549
new file mode 100644
index 0000000..315bf35
--- /dev/null
+++ b/.werks/1549
@@ -0,0 +1,11 @@
+Title: bluecat_threads: do not inventorize this check where information is missing
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.5i7
+Date: 1416913048
+
+This avoid UNKNOWN check results on devices where no thread information is
+available.
diff --git a/ChangeLog b/ChangeLog
index 229af5d..9a22256 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -40,6 +40,7 @@
* 1449 FIX: nginx_status: agent plugin no longer honours "http(s)_proxy" env variables of root user
* 1532 FIX: mk_sap: Cleaning up old state information from sap.state file...
* 1548 FIX: bluecat_ntp: do not inventorized devices where NTP information is missing
+ * 1549 FIX: bluecat_threads: do not inventorize this check where information is missing...
Multisite:
* 1508 Allow input of plugin output and perfdata when faking check results...
diff --git a/checks/bluecat_threads b/checks/bluecat_threads
index 7b67507..49c2e32 100644
--- a/checks/bluecat_threads
+++ b/checks/bluecat_threads
@@ -28,7 +28,8 @@
threads_default_levels = (2000, 4000)
def inventory_bluecat_threads(info):
- return [(None, "threads_default_levels")]
+ if info:
+ return [(None, "threads_default_levels")]
def check_bluecat_threads(item, params, info):
nthreads = int(info[0][0])
small speedup for large Multisite pages
Message-ID: <54745ede.wW1gBWvn0xMnqWQc%mk(a)mathias-kettner.de>
User-Agent: Heirloom mailx 12.5 6/20/10
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Module: check_mk
Branch: master
Commit: be7a859377ccad63b8740ebbf1b2e1033f87b302
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=be7a859377ccad…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Nov 25 11:50:03 2014 +0100
Faster implementation of attrencode, small speedup for large Multisite pages
---
web/htdocs/htmllib.py | 14 +-------------
1 file changed, 1 insertion(+), 13 deletions(-)
diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py
index c43be21..1727e0f 100644
--- a/web/htdocs/htmllib.py
+++ b/web/htdocs/htmllib.py
@@ -1213,19 +1213,7 @@ class html:
elif type(value) not in [str, unicode]:
value = str(value)
- new = ""
- for c in value:
- if c == '"':
- new += """
- elif c == '<':
- new += "<"
- elif c == '>':
- new += ">"
- else:
- new += c
- return new
-
-
+ return value.replace('"', """).replace("<", "<").replace(">", ">")
# This function returns a str object, never unicode!
# Beware: this code is crucial for the performance of Multisite!
Module: check_mk
Branch: master
Commit: 110cd6b42743bc5470cb32f8fa2baf5ab6c40367
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=110cd6b42743bc…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Nov 25 10:32:32 2014 +0100
#1532 FIX mk_sap: Cleaning up old state information from sap.state file
The mk_sap agent plugin writes a state file which contains information
for each SAP alert log file which is monitored. Old log files are now
cleaned up from this file, when they are not monitored anymore.
---
.werks/1532 | 11 +++++++++++
ChangeLog | 1 +
agents/plugins/mk_sap | 46 +++++++++++++++++++++++++++++++++++++---------
3 files changed, 49 insertions(+), 9 deletions(-)
diff --git a/.werks/1532 b/.werks/1532
new file mode 100644
index 0000000..bf6feb4
--- /dev/null
+++ b/.werks/1532
@@ -0,0 +1,11 @@
+Title: mk_sap: Cleaning up old state information from sap.state file
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.5i7
+Date: 1416907854
+Class: fix
+
+The mk_sap agent plugin writes a state file which contains information
+for each SAP alert log file which is monitored. Old log files are now
+cleaned up from this file, when they are not monitored anymore.
diff --git a/ChangeLog b/ChangeLog
index a5092a2..bc3f9df 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -38,6 +38,7 @@
* 1503 FIX: Fixed monitoring of multiple SAP instances with one mk_sap plugin...
* 1515 FIX: cisco_secure: fix service description, fix OK state in case of no violation
* 1449 FIX: nginx_status: agent plugin no longer honours "http(s)_proxy" env variables of root user
+ * 1532 FIX: mk_sap: Cleaning up old state information from sap.state file...
Multisite:
* 1508 Allow input of plugin output and perfdata when faking check results...
diff --git a/agents/plugins/mk_sap b/agents/plugins/mk_sap
index 8f867df..747f9ae 100755
--- a/agents/plugins/mk_sap
+++ b/agents/plugins/mk_sap
@@ -109,6 +109,7 @@ SKIP_MTCLASSES = [
]
STATE_FILE = '/etc/check_mk/sap.state'
+state_file_changed = False
# #############################################################################
@@ -139,7 +140,6 @@ monitor_paths = [
# 'SAP CCMS Monitor Templates/Dialog Overview/*',
]
monitor_types = []
-# henri
config_file = os.getenv('MK_CONFDIR', '/etc/check_mk') + '/sap.cfg'
cfg = {}
@@ -156,6 +156,10 @@ try:
except IOError:
states = {}
+# index of all logfiles which have been found in a run. This is used to
+# remove logfiles which are not available anymore from the states dict.
+logfiles = []
+
# #############################################################################
#
@@ -322,6 +326,8 @@ def alert_details(cfg, alert):
return state, msg
def process_alerts(cfg, logs, ms_name, mon_name, node, alerts):
+ global state_file_changed
+
sid = node["MTSYSID"].strip() or 'Other'
context = node["MTMCNAME"].strip() or 'Other'
path = node["PATH"]
@@ -330,6 +336,8 @@ def process_alerts(cfg, logs, ms_name, mon_name, node, alerts):
hostname = sid
logfile = context + "/" + path
+ logfiles.append((hostname, logfile))
+
logs.setdefault(sid, {})
logs[hostname][logfile] = []
newest_log_dt = None
@@ -350,7 +358,7 @@ def process_alerts(cfg, logs, ms_name, mon_name, node, alerts):
if newest_log_dt:
# Write newest log age to cache to prevent double processing of logs
states[(hostname, logfile)] = newest_log_dt
- file(STATE_FILE, 'w').write(repr(states))
+ state_file_changed = True
return logs
@@ -452,12 +460,32 @@ def check(cfg):
# It is possible to configure multiple SAP instances to monitor. Loop them all, but
# do not terminate when one connection failed
-for entry in cfg:
- try:
- check(entry)
- except sapnwrfc.RFCCommunicationError, e:
- sys.stderr.write('ERROR: Unable to connect (%s)\n' % e)
- except:
- sys.stderr.write('ERROR: Unhandled exception (%s)\n' % e)
+processed_all = True
+try:
+ for entry in cfg:
+ try:
+ check(entry)
+ except sapnwrfc.RFCCommunicationError, e:
+ sys.stderr.write('ERROR: Unable to connect (%s)\n' % e)
+ processed_all = False
+ except Exception, e:
+ sys.stderr.write('ERROR: Unhandled exception (%s)\n' % e)
+ processed_all = False
+
+ # Now check whether or not an old logfile needs to be removed. This can only
+ # be done this way, when all hosts have been reached. Otherwise the cleanup
+ # is skipped.
+ if processed_all:
+ for key in states.keys():
+ if key not in logfiles:
+ state_file_changed = True
+ del states[key]
+
+ # Only write the state file once per run. And only when it has been changed
+ if state_file_changed:
+ file(STATE_FILE, 'w').write(repr(states))
+
+except Exception, e:
+ sys.stderr.write('ERROR: Unhandled exception (%s)\n' % e)
sys.exit(0)
Module: check_mk
Branch: master
Commit: 1cf1c6ae1d62c5a9ae227f405916399805e7e8d1
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1cf1c6ae1d62c5…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Nov 25 10:14:43 2014 +0100
Updated bug entries #2206
---
.bugs/2206 | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/.bugs/2206 b/.bugs/2206
new file mode 100644
index 0000000..318df69
--- /dev/null
+++ b/.bugs/2206
@@ -0,0 +1,22 @@
+Title: Rework "crashed checks" mechanism
+Component: core
+State: open
+Date: 2014-11-25 10:11:51
+Targetversion: 1.2.5i1
+Class: todo
+
+The optional crashed checks log should be replaced by a new mechanism
+where each exception is written to a dedicated folder hierarchy like
+HOST/SERVICE, where only the last exception is stored per service.
+It is written as text file where all needed information like
+
+a) the raw agent output
+b) the raw SNMP data
+c) the traceback
+
+are written to.
+
+This file can be downloaded from the Web-GUI by clicking on an icon
+which is shown when there is some file for a service available.
+
+The files are removed using the diskspace cleanup mechanism regularly.
Module: check_mk
Branch: master
Commit: 51209db66fd5529e420f3f78a2716f6bb4b89112
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=51209db66fd552…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Nov 24 15:13:46 2014 +0100
Updated bug entries #2205
---
.bugs/2205 | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/.bugs/2205 b/.bugs/2205
new file mode 100644
index 0000000..d9ac414
--- /dev/null
+++ b/.bugs/2205
@@ -0,0 +1,10 @@
+Title: Path in debug_log is wrong in distributed WATO setups
+Component: wato
+State: open
+Date: 2014-11-24 15:07:07
+Targetversion: 1.2.5i1
+Class: bug
+
+The shown path always shows the path on the centeral site. It should either
+show the path to the correct site, or better, just a spacer which indicates
+that the site id needs to be put into the path.