Module: check_mk
Branch: master
Commit: d907571692a4c09ef05f6b8e0706a059fbfc2f9d
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d907571692a4c0…
Author: Sebastian Herbord <sh(a)mathias-kettner.de>
Date: Thu Apr 21 15:21:03 2016 +0200
3124 FIX workaround for overrunnig counters in a couple of wmi checks
Please note that this is just a workaround, it will still produce wrong output at some point.
There doesn't seem to be a correct way to work with a wrap in performance counters.
---
.werks/3124 | 11 +++++++++++
ChangeLog | 1 +
checks/wmi.include | 18 ++++++++++++------
3 files changed, 24 insertions(+), 6 deletions(-)
diff --git a/.werks/3124 b/.werks/3124
new file mode 100644
index 0000000..8735db0
--- /dev/null
+++ b/.werks/3124
@@ -0,0 +1,11 @@
+Title: workaround for overrunnig counters in a couple of wmi checks
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.9i1
+Date: 1461243484
+
+Please note that this is just a workaround, it will still produce wrong output at some point.
+There doesn't seem to be a correct way to work with a wrap in performance counters.
diff --git a/ChangeLog b/ChangeLog
index 3444ad8..29b051d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -166,6 +166,7 @@
NOTE: Please refer to the migration notes!
* 3387 FIX: ps: Fixed crash during service discovery on AIX hosts having defunct processes
* 3417 FIX: wmi_cpuload: fix exception in case of missing NumberOfLogicalProcessors on some OS versions
+ * 3124 FIX: workaround for overrunnig counters in a couple of wmi checks...
Multisite:
* 3187 notification view: new filter for log command via regex
diff --git a/checks/wmi.include b/checks/wmi.include
index 7795213..6dcb798 100644
--- a/checks/wmi.include
+++ b/checks/wmi.include
@@ -267,11 +267,11 @@ def wmi_yield_raw_counter(table, row, column, label, perfvar, levels=None):
[wmi_make_perfvar(perfvar, value, levels)])
-def wmi_calculate_raw_average(table, row, column):
+def wmi_calculate_raw_average(table, row, column, factor):
if row == "":
row = 0
- time_spent_total = int(table.get(row, column))
+ measure = int(table.get(row, column)) * factor
base = int(table.get(row, column + "_Base"))
if base < 0:
@@ -283,13 +283,20 @@ def wmi_calculate_raw_average(table, row, column):
if base == 0:
return 0.0
- return float(time_spent_total) / base
+ # This is a total counter which can overflow on long-running systems
+ # (great choice of datatype, microsoft!)
+ # the following forces the counter into a range of 0.0-1.0, but there is no way to know
+ # how often the counter overran, so this bay still be wrong
+ while (base * factor) < measure:
+ base += 1 << 32
+
+ return float(measure) / base
def wmi_yield_raw_average(table, row, column, label, perfvar, levels=None):
levels = wmi_fix_levels(levels)
- average = wmi_calculate_raw_average(table, row, column)
+ average = wmi_calculate_raw_average(table, row, column, 1)
return (
wmi_determine_status(average, levels),
@@ -301,7 +308,7 @@ def wmi_yield_raw_average(table, row, column, label, perfvar, levels=None):
def wmi_yield_raw_fraction(table, row, column, label, perfvar, levels=None):
levels = wmi_fix_levels(levels)
- average = wmi_calculate_raw_average(table, row, column) * 100
+ average = wmi_calculate_raw_average(table, row, column, 100)
status = wmi_determine_status(average, levels)
return (
@@ -310,6 +317,5 @@ def wmi_yield_raw_fraction(table, row, column, label, perfvar, levels=None):
[wmi_make_perfvar(perfvar, average, levels, 0, 100)]
)
-
#.
Module: check_mk
Branch: master
Commit: 2e20ba58bb9fe6c6c5dd6878b1fee380fa349a54
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2e20ba58bb9fe6…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Apr 20 12:02:14 2016 +0200
3388 Event Console can now process SNMPv3 traps
The Event Console can now process SNMPv3 traps send with SNMPv3. To be able to receive
the traps, you will have to configure the SNMPv3 credentials to be used for decrypting
the received traps. This can be done in the Event Console configuration using the
option <i>Credentials for processing SNMPv3 traps</i>.
For each sending server you need to configure the credentials and the systems engine ID
which is normally generated automatically by the SNMP device. Some devices also support
setting engine IDs on your own. However, the SNMPv3 specification requires that each
SNMP device has it's own unique engine ID. To be able to decrypt the traps you need to
configure this engine ID together with the other SNMPv3 credentials for each trap sending
device.
---
.werks/3388 | 19 +++
ChangeLog | 1 +
bin/.f12 | 1 +
bin/mkeventd | 189 +++++++++++++++++++++-------
web/plugins/wato/check_mk_configuration.py | 117 +++++++++--------
web/plugins/wato/mkeventd.py | 39 ++++++
6 files changed, 270 insertions(+), 96 deletions(-)
Diff: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=2e20ba58bb…
Module: check_mk
Branch: master
Commit: 16986a19974f507e227b7c025745d4b9cebc347b
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=16986a19974f50…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Apr 20 11:21:16 2016 +0200
3418 FIX Do not send host notifications if a service group is required
If you set a match condition on the service groups then for host notifications
this condition was ignored. But a host cannot be in any service group so now
if you use this condition then the rule will never match for host notifications.
This should be the way that you expect this.
---
.werks/3418 | 13 +++++++++++++
ChangeLog | 2 ++
modules/events.py | 8 ++++++--
web/htdocs/wato.py | 3 ++-
4 files changed, 23 insertions(+), 3 deletions(-)
diff --git a/.werks/3418 b/.werks/3418
new file mode 100644
index 0000000..a7ca4f5
--- /dev/null
+++ b/.werks/3418
@@ -0,0 +1,13 @@
+Title: Do not send host notifications if a service group is required
+Level: 2
+Component: notifications
+Class: fix
+Compatible: incomp
+State: unknown
+Version: 1.2.9i1
+Date: 1461143929
+
+If you set a match condition on the service groups then for host notifications
+this condition was ignored. But a host cannot be in any service group so now
+if you use this condition then the rule will never match for host notifications.
+This should be the way that you expect this.
diff --git a/ChangeLog b/ChangeLog
index 8463214..169d4f3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -295,6 +295,8 @@
* 3253 FIX: sms: notification script sms now handles single quotes in the message in the right way
* 3346 FIX: Re-added envelope sender to asciimail/mail notification plugins
* 3380 FIX: Fixed graphs in service notifications having spaces in service descriptions
+ * 3418 FIX: Do not send host notifications if a service group is required...
+ NOTE: Please refer to the migration notes!
BI:
* 3271 New option in aggregation for tuning aggregation of downtimes...
diff --git a/modules/events.py b/modules/events.py
index 3f90de7..8d34e7d 100644
--- a/modules/events.py
+++ b/modules/events.py
@@ -332,9 +332,13 @@ def event_match_hosttags(rule, context):
def event_match_servicegroups(rule, context):
- if context["WHAT"] != "SERVICE":
- return
required_groups = rule.get("match_servicegroups")
+ if context["WHAT"] != "SERVICE":
+ if required_groups:
+ return "This rule requires membership in a service group, but this is a host notification"
+ else:
+ return
+
if required_groups != None:
sgn = context.get("SERVICEGROUPNAMES")
if sgn == None:
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 40f14c4..187a677 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -7212,7 +7212,8 @@ def generic_rule_match_conditions():
( "match_servicegroups",
GroupChoice("service",
title = _("Match Service Groups"),
- help = _("The service must be in one of the selected service groups"),
+ help = _("The service must be in one of the selected service groups. For host events this condition "
+ "never matches as soon as at least one group is selected."),
allow_empty = False,
)
),