Module: check_mk
Branch: master
Commit: e66840b0f5adbef9bea7c2a2edbec824c3c32231
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e66840b0f5adbe…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Wed Mar 16 16:35:19 2016 +0100
3012 jolokia_metrics.threads: Improved check output, now showing the actual problem and
levels
---
.werks/3012 | 9 +++++++++
ChangeLog | 1 +
checks/jolokia_metrics | 5 ++++-
3 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/.werks/3012 b/.werks/3012
new file mode 100644
index 0000000..5925568
--- /dev/null
+++ b/.werks/3012
@@ -0,0 +1,9 @@
+Title: jolokia_metrics.threads: Improved check output, now showing the actual problem and
levels
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.9i1
+Date: 1458142474
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 4943e3d..ff54d15 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -31,6 +31,7 @@
* 3101 zpool: new check to monitor usage of zfs pools...
* 3103 brocade_optical: new check to monitor signal strength of optical network ports
on Brocade switches
* 3303 cisco_fru_module_status: new check which monitors the operational status of
FRU modules of Cisco devices which support the CISCO-ENTITY-FRU-CONTROL-MIB
+ * 3012 jolokia_metrics.threads: Improved check output, now showing the actual problem
and levels
* 3073 FIX: windows agent: relative paths to mrpe scripts are now treated as relative
to the agent installation directory...
* 3061 FIX: mk_jolokia: Fixed debugging of the agent plugin
* 3074 FIX: windows agent: fixed incorrect values for 32-bit performance counters
diff --git a/checks/jolokia_metrics b/checks/jolokia_metrics
index 0ad4b34..b1c3921 100644
--- a/checks/jolokia_metrics
+++ b/checks/jolokia_metrics
@@ -396,12 +396,15 @@ def check_jolokia_metrics_threads(item, params, info):
continue # The keys might be optional (saw jboss only sending ThreadCount)
val = int(d[key])
+ status_info = ""
if key == 'ThreadCount':
# Thread count might lead to a warn/crit state
if val >= crit:
status = 2
+ status_info = "(!!) (Levels at %d/%d)" % (warn, crit)
elif val >= warn:
status = 1
+ status_info = "(!) (Levels at %d/%d)" % (warn, crit)
# Calculate the thread increase rate
try:
@@ -412,7 +415,7 @@ def check_jolokia_metrics_threads(item, params, info):
wrapped = True
perfdata.append((key, val))
- output.append('%s: %d' % (key, val))
+ output.append('%s: %d%s' % (key, val, status_info))
# Only process the perfdata when no wrap occured
if wrapped:
return (status, ', '.join(output))