Module: check_mk
Branch: master
Commit: b8c79e12e3e2b744db1a9eb2207d0e67c041c3aa
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b8c79e12e3e2b7…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Dec 19 13:48:23 2017 +0100
5582 FIX hr_cpu: Fixed displaying of "per core CPU utilization" in raw edition graphs
Change-Id: Ie4d25040e1422eb1aa5894fe1176eccbb496b06a
---
.werks/5582 | 11 +++++++++++
pnp-templates/check_mk-hr_cpu.php | 39 ---------------------------------------
2 files changed, 11 insertions(+), 39 deletions(-)
diff --git a/.werks/5582 b/.werks/5582
new file mode 100644
index 0000000..6210a8f
--- /dev/null
+++ b/.werks/5582
@@ -0,0 +1,11 @@
+Title: hr_cpu: Fixed displaying of "per core CPU utilization" in raw edition graphs
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i2
+Date: 1513687681
+
+
diff --git a/pnp-templates/check_mk-hr_cpu.php b/pnp-templates/check_mk-hr_cpu.php
deleted file mode 100644
index 0a548ed..0000000
--- a/pnp-templates/check_mk-hr_cpu.php
+++ /dev/null
@@ -1,39 +0,0 @@
-<?php
-# +------------------------------------------------------------------+
-# | ____ _ _ __ __ _ __ |
-# | / ___| |__ ___ ___| | __ | \/ | |/ / |
-# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
-# | | |___| | | | __/ (__| < | | | | . \ |
-# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
-# | |
-# | Copyright Mathias Kettner 2014 mk(a)mathias-kettner.de |
-# +------------------------------------------------------------------+
-#
-# This file is part of Check_MK.
-# The official homepage is at http://mathias-kettner.de/check_mk.
-#
-# check_mk is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by
-# the Free Software Foundation in version 2. check_mk is distributed
-# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
-# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE. See the GNU General Public License for more de-
-# tails. You should have received a copy of the GNU General Public
-# License along with GNU Make; see the file COPYING. If not, write
-# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
-# Boston, MA 02110-1301 USA.
-
-$opt[1] = "--vertical-label 'CPU utilization %' -l0 -u 100 --title \"CPU Utilization for $hostname\" ";
-#
-$def[1] = "DEF:util=$RRDFILE[1]:$DS[1]:AVERAGE " ;
-$def[1] .= "CDEF:idle=100,util,- ";
-
-$def[1] .= "AREA:util#60f020:\"Utilization\":STACK " ;
-$def[1] .= "GPRINT:util:MIN:\"Min\: %2.1lf%%\" " ;
-$def[1] .= "GPRINT:util:MAX:\"Max\: %2.1lf%%\" " ;
-$def[1] .= "GPRINT:util:LAST:\"Last\: %2.1lf%%\" " ;
-
-$def[1] .= "LINE:idle#ffffff:\"Idle\" " ;
-$def[1] .= "GPRINT:idle:LAST:\"%2.1lf%%\" " ;
-
-?>
Module: check_mk
Branch: master
Commit: e57d794db916eab33d71889d3b25b93a53c7d5b5
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e57d794db916ea…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Dec 19 15:01:37 2017 +0100
5584 FIX Fixed exception when "Export List of Software packages as CSV file" is enabled
When having the export of the software packages list via CSV enabled while execution
of the HW/SW inventory, an exception could happen in case the inventory data contained
special characters. The exception looked like this on the command line:
Traceback (most recent call last):
File "/omd/sites/stable/share/check_mk/modules/check_mk.py", line 4811, in <module>
do_inv(hostnames)
File "/omd/sites/stable/share/check_mk/modules/inventory.py", line 180, in do_inv
do_inv_for(hostname)
File "/omd/sites/stable/share/check_mk/modules/inventory.py", line 267, in do_inv_for
run_inv_export_hooks(hostname, g_inv_tree)
File "/omd/sites/stable/share/check_mk/modules/inventory.py", line 383, in run_inv_export_hooks
inv_export[hookname]["export_function"](hostname, params, tree)
File "/omd/sites/stable/share/check_mk/inventory/export_software_csv", line 67, in inv_export_software_csv
out.write("%s\n" % separator.join(line))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in position 1: ordinal not in range(128)
Change-Id: I961f759a2048198038a46dd345be96c96c051259
---
.werks/5584 | 27 +++++++++++++++++++++++++++
inventory/export_software_csv | 2 +-
2 files changed, 28 insertions(+), 1 deletion(-)
diff --git a/.werks/5584 b/.werks/5584
new file mode 100644
index 0000000..35a49f1
--- /dev/null
+++ b/.werks/5584
@@ -0,0 +1,27 @@
+Title: Fixed exception when "Export List of Software packages as CSV file" is enabled
+Level: 1
+Component: inv
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i2
+Date: 1513692003
+
+When having the export of the software packages list via CSV enabled while execution
+of the HW/SW inventory, an exception could happen in case the inventory data contained
+special characters. The exception looked like this on the command line:
+
+Traceback (most recent call last):
+ File "/omd/sites/stable/share/check_mk/modules/check_mk.py", line 4811, in <module>
+ do_inv(hostnames)
+ File "/omd/sites/stable/share/check_mk/modules/inventory.py", line 180, in do_inv
+ do_inv_for(hostname)
+ File "/omd/sites/stable/share/check_mk/modules/inventory.py", line 267, in do_inv_for
+ run_inv_export_hooks(hostname, g_inv_tree)
+ File "/omd/sites/stable/share/check_mk/modules/inventory.py", line 383, in run_inv_export_hooks
+ inv_export[hookname]["export_function"](hostname, params, tree)
+ File "/omd/sites/stable/share/check_mk/inventory/export_software_csv", line 67, in inv_export_software_csv
+ out.write("%s\n" % separator.join(line))
+UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in position 1: ordinal not in range(128)
+
diff --git a/inventory/export_software_csv b/inventory/export_software_csv
index fdc59b7..068866f 100644
--- a/inventory/export_software_csv
+++ b/inventory/export_software_csv
@@ -64,7 +64,7 @@ def inv_export_software_csv(hostname, params, tree):
line = []
for key in keys:
line.append(quote(package.get(key, "")))
- out.write("%s\n" % separator.join(line))
+ out.write(("%s\n" % separator.join(line)).encode("utf-8"))
inv_export['software_csv'] = {
Module: check_mk
Branch: master
Commit: 5e91689e66cd56bcd3d7145e250dd700cdc649f1
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5e91689e66cd56…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Tue Dec 19 11:04:44 2017 +0100
5527 FIX ucd_mem, hr_mem: Prefer ucd_mem check for certain Cisco IronPort models
For certain Cisco IronPort devices, the OIDs defined in the Host Resources MIB
provide bogus data. This can be avoided by using the ucd_mem check instead for
these devices.
To benefit from this fix, the affected devices need to be rediscovered.
Change-Id: I21f023a14f0c8c420b57549fb1a033b22f727575
---
.werks/5527 | 15 +++++++++++++++
checks/ucd.include | 1 +
2 files changed, 16 insertions(+)
diff --git a/.werks/5527 b/.werks/5527
new file mode 100644
index 0000000..c468161
--- /dev/null
+++ b/.werks/5527
@@ -0,0 +1,15 @@
+Title: ucd_mem, hr_mem: Prefer ucd_mem check for certain Cisco IronPort models
+Level: 1
+Component: checks
+Class: fix
+Compatible: incomp
+Edition: cre
+State: unknown
+Version: 1.5.0i2
+Date: 1513677694
+
+For certain Cisco IronPort devices, the OIDs defined in the Host Resources MIB
+provide bogus data. This can be avoided by using the ucd_mem check instead for
+these devices.
+
+To benefit from this fix, the affected devices need to be rediscovered.
diff --git a/checks/ucd.include b/checks/ucd.include
index cffa43d..e205a4b 100644
--- a/checks/ucd.include
+++ b/checks/ucd.include
@@ -57,6 +57,7 @@ def hr_mem_scan_function(oid):
# of devices, which are known to report incorrect information
# about mem usage
return (not "pfsense" in oid(".1.3.6.1.2.1.1.1.0").lower() and \
+ not "ironport model c3" in oid(".1.3.6.1.2.1.1.1.0").lower() and \
ignore_ucd_and_hr(oid)) or \
(oid(".1.3.6.1.2.1.25.1.1.0") and \
not ucd_scan_function(oid))
Module: check_mk
Branch: master
Commit: 4b19fbf6cb76da219945a6a2efe2d40fee85f17d
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4b19fbf6cb76da…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Mon Dec 18 17:21:18 2017 +0100
checktestlib: New class for representing a perf value
Change-Id: If2930fe7890cc457cbb4aa386b39a8eeb55e28e5
---
tests/checks/checktestlib.py | 43 ++++++++++++++++++++++++++++++++-----------
1 file changed, 32 insertions(+), 11 deletions(-)
diff --git a/tests/checks/checktestlib.py b/tests/checks/checktestlib.py
index d785241..8bae61c 100644
--- a/tests/checks/checktestlib.py
+++ b/tests/checks/checktestlib.py
@@ -1,3 +1,31 @@
+class PerfValue(object):
+ """Represents a single perf value"""
+
+ def __init__(self, key, value, warn=None, crit=None, minimum=None, maximum=None):
+ # TODO: This is very basic. There is more way more magic involved
+ # in what kind of values are allowed as metric names.
+ # I'm not too sure unicode should be allowed, either.
+ assert type(key) in [str, unicode]
+ self.key = key
+
+ # NOTE: The CMC as well as all other Nagios-compatible cores do accept a
+ # string value that may contain a unit, which is in turn available
+ # for use in PNP4Nagios templates. Check_MK defines its own semantic
+ # context for performance values using Check_MK metrics. It is therefore
+ # preferred to return a "naked" scalar.
+ assert type(value) in [int, float]
+ self.value = value
+
+ assert type(warn) in [int, float, type(None)]
+ self.warn = warn
+ assert type(crit) in [int, float, type(None)]
+ self.crit = crit
+ assert type(minimum) in [int, float, type(None)]
+ self.minimum = minimum
+ assert type(maximum) in [int, float, type(None)]
+ self.maximum = maximum
+
+
class BasicCheckResult(object):
"""A basic check result
@@ -15,20 +43,13 @@ class BasicCheckResult(object):
self.infotext = infotext
if perfdata is not None:
assert type(perfdata) == list
- assert all([len(entry) >= 2 for entry in perfdata])
+ self.perfdata = []
for entry in perfdata:
assert type(entry) == tuple
- assert len(entry) >= 2
-
- # TODO: This is very basic. There is more way more magic involved
- # in what kind of values are allowed as metric names.
- # I'm not too sure unicode should be allowed, either.
- assert type(entry[0]) in [str, unicode]
-
- assert type(entry[1]) in [int, float]
- assert all(type(value) in [int, float, type(None)] for value in entry[2:])
- self.perfdata = perfdata
+ self.perfdata.append(PerfValue(*entry))
+ else:
+ self.perfdata = None
def match_status(self, expected_status):
"""Check if this result's status matches a given value. Exact match."""