host search was infix search instead of full match)
Message-ID: <56404f9c.xJpK3LzOPK1kF4ha%lm(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: d70241bd64f2eb0bf6ce19e79bfd9b9f17083702
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d70241bd64f2eb…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Nov 9 08:45:02 2015 +0100
#2757 FIX Events Check: Fixed check finding too many events (host search was infix search instead of full match)
The "Check event state in event console" check (check_mkevents) was finding too many events in case
the check was configured to search for hostname and ipaddress of a host. The regular expression used
for matching was constructed as infix search, not as full match.
---
.werks/2757 | 12 ++++++++++++
ChangeLog | 1 +
mkeventd/lib/check_mkevents.cc | 3 ++-
3 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/.werks/2757 b/.werks/2757
new file mode 100644
index 0000000..dcacf1c
--- /dev/null
+++ b/.werks/2757
@@ -0,0 +1,12 @@
+Title: Events Check: Fixed check finding too many events (host search was infix search instead of full match)
+Level: 1
+Component: ec
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i4
+Date: 1447054989
+
+The "Check event state in event console" check (check_mkevents) was finding too many events in case
+the check was configured to search for hostname and ipaddress of a host. The regular expression used
+for matching was constructed as infix search, not as full match.
diff --git a/ChangeLog b/ChangeLog
index 8b952b1..ef83a5d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -98,6 +98,7 @@
Event Console:
* 2733 Visibility of Event Console events more flexible now...
* 2719 FIX: Events Check: Links to EC were broken when using regular expressions as application...
+ * 2757 FIX: Events Check: Fixed check finding too many events (host search was infix search instead of full match)...
Livestatus:
* 2743 FIX: Fixed handling of column types in "GET columns"...
diff --git a/mkeventd/lib/check_mkevents.cc b/mkeventd/lib/check_mkevents.cc
index 67a8b01..d7ac3ec 100644
--- a/mkeventd/lib/check_mkevents.cc
+++ b/mkeventd/lib/check_mkevents.cc
@@ -196,8 +196,9 @@ int main(int argc, char** argv)
string query_message;
query_message += "GET events\nFilter: event_host ";
if (strchr(host, '/')) {
- query_message += "~~ ";
+ query_message += "~~ ^(";
query_message += prepare_hostname_regex(host);
+ query_message += ")$";
}
else {
query_message += "=~ ";
Module: check_mk
Branch: master
Commit: 4dd57bd81690d59621188621fd806777ad41d7a1
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4dd57bd81690d5…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Nov 6 17:57:12 2015 +0100
#2756 FIX SNMP: Generalized error handling of emtpy info for SNMP checks
This change changes the way empty data for SNMP checks is handled.
In previous version each SNMP check had to deal with the fact that
the SNMP agent could respond with an empty response (info = []).
This situation can better be handled in the Check_MK SNMP engine
which catches this issue now before calling the discovery/check
function of the check. The error is then reported as missing info
like for the Check_MK Agent based checks.
There might be some special SNMP checks which need to treat this
case of empty data on its own. These checks now need to declare
the attribute <tt>handle_empty_info</tt> in the <tt>check_info</tt>.
---
.werks/2756 | 20 ++++++++++++++++++++
ChangeLog | 1 +
modules/check_mk_base.py | 10 ++++++++++
modules/discovery.py | 7 +++++++
4 files changed, 38 insertions(+)
diff --git a/.werks/2756 b/.werks/2756
new file mode 100644
index 0000000..cc5219a
--- /dev/null
+++ b/.werks/2756
@@ -0,0 +1,20 @@
+Title: SNMP: Generalized error handling of emtpy info for SNMP checks
+Level: 2
+Component: core
+Compatible: compat
+Version: 1.2.7i4
+Date: 1446828681
+Class: fix
+
+This change changes the way empty data for SNMP checks is handled.
+In previous version each SNMP check had to deal with the fact that
+the SNMP agent could respond with an empty response (info = []).
+
+This situation can better be handled in the Check_MK SNMP engine
+which catches this issue now before calling the discovery/check
+function of the check. The error is then reported as missing info
+like for the Check_MK Agent based checks.
+
+There might be some special SNMP checks which need to treat this
+case of empty data on its own. These checks now need to declare
+the attribute <tt>handle_empty_info</tt> in the <tt>check_info</tt>.
diff --git a/ChangeLog b/ChangeLog
index 01e4df1..8b952b1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,7 @@
* 2443 FIX: Fixed quoting of ! in classical nagios checks configured via WATO...
* 2718 FIX: Fixed agent timeouts not resulting in a crash report anympore...
* 2724 FIX: Discovery check: Fixed exception in simulation mode when no cache file present
+ * 2756 FIX: SNMP: Generalized error handling of emtpy info for SNMP checks...
Checks & Agents:
* 2434 NetApp monitoring: Cluster-Mode is now supported, changes in existing 7Mode checks...
diff --git a/modules/check_mk_base.py b/modules/check_mk_base.py
index a88b355..f13dee0 100644
--- a/modules/check_mk_base.py
+++ b/modules/check_mk_base.py
@@ -1416,6 +1416,14 @@ def do_all_checks_on_host(hostname, ipaddress, only_check_types = None):
except MKParseFunctionError, e:
info = e
+ # In case of SNMP checks but missing agent response, skip this check.
+ # Special checks which still need to be called even with empty data
+ # may declare this.
+ if info == [] and check_uses_snmp(checkname) \
+ and not check_info[checkname]["handle_empty_info"]:
+ error_sections.add(infotype)
+ continue
+
if info or info == []:
num_success += 1
try:
@@ -1628,6 +1636,7 @@ def convert_check_info():
"snmp_scan_function" :
snmp_scan_functions.get(check_type,
snmp_scan_functions.get(basename)),
+ "handle_empty_info" : False,
"default_levels_variable" : check_default_levels.get(check_type),
"node_info" : False,
"parse_function" : None,
@@ -1641,6 +1650,7 @@ def convert_check_info():
info.setdefault("group", None)
info.setdefault("snmp_info", None)
info.setdefault("snmp_scan_function", None)
+ info.setdefault("handle_empty_info", False)
info.setdefault("default_levels_variable", None)
info.setdefault("node_info", False)
info.setdefault("extra_sections", [])
diff --git a/modules/discovery.py b/modules/discovery.py
index 807527e..2e281f3 100644
--- a/modules/discovery.py
+++ b/modules/discovery.py
@@ -737,6 +737,13 @@ def discover_check_type(hostname, ipaddress, check_type, use_caches, on_error):
if info == None: # No data for this check type
return []
+ # In case of SNMP checks but missing agent response, skip this check.
+ # Special checks which still need to be called even with empty data
+ # may declare this.
+ if not info and check_uses_snmp(check_type) \
+ and not check_info[check_type]["handle_empty_info"]:
+ return []
+
# Now do the actual inventory
try:
# Check number of arguments of discovery function. Note: This
Module: check_mk
Branch: master
Commit: a6c6b7e30dc8ba3e0560a784df1a46bb80952fa9
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a6c6b7e30dc8ba…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Nov 6 16:38:09 2015 +0100
#2754 FIX ipmitool: Killing asynchronous ipmitool call after 300 seconds
The ipmitool command can take a long time to return on some systems.
But the agent needs to ensure that not too many ipmitool processes
are open at the same time.
---
.werks/2754 | 12 ++++++++++++
ChangeLog | 1 +
agents/check_mk_agent.linux | 2 +-
3 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/.werks/2754 b/.werks/2754
new file mode 100644
index 0000000..108e0c9
--- /dev/null
+++ b/.werks/2754
@@ -0,0 +1,12 @@
+Title: ipmitool: Killing asynchronous ipmitool call after 300 seconds
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i4
+Date: 1446824182
+
+The ipmitool command can take a long time to return on some systems.
+But the agent needs to ensure that not too many ipmitool processes
+are open at the same time.
diff --git a/ChangeLog b/ChangeLog
index 1c670ff..83b7a8e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -58,6 +58,7 @@
* 2731 FIX: smart.temp: Handles case of missing temperature values correctly
* 2753 FIX: ad_replication: Made check more robust agains garbled agent output
* 2773 FIX: omd_staomd_status: handle case where site's software installation is broken
+ * 2754 FIX: ipmitool: Killing asynchronous ipmitool call after 300 seconds...
Multisite:
* 2684 Added icons for downloading agent data / walks of hosts...
diff --git a/agents/check_mk_agent.linux b/agents/check_mk_agent.linux
index 84071c8..05d2cb3 100755
--- a/agents/check_mk_agent.linux
+++ b/agents/check_mk_agent.linux
@@ -306,7 +306,7 @@ cat /proc/vmstat /proc/stat
# Hardware sensors via IPMI (need ipmitool)
if type ipmitool > /dev/null
then
- run_cached -s ipmi 300 "ipmitool sensor list | grep -v 'command failed' | sed -e 's/ *| */|/g' -e 's/ /_/g' -e 's/_*"'$'"//' -e 's/|/ /g' | egrep -v '^[^ ]+ na ' | grep -v ' discrete '"
+ run_cached -s ipmi 300 "waitmax 300 ipmitool sensor list | grep -v 'command failed' | sed -e 's/ *| */|/g' -e 's/ /_/g' -e 's/_*"'$'"//' -e 's/|/ /g' | egrep -v '^[^ ]+ na ' | grep -v ' discrete '"
fi
Module: check_mk
Branch: master
Commit: 696221b40e883065056bf30832f27e74cc95a285
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=696221b40e8830…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Nov 6 16:26:06 2015 +0100
#2774 FIX Fix exception when deleting certain types of MIBs
---
.werks/2774 | 10 ++++++++++
ChangeLog | 1 +
mkeventd/web/plugins/wato/mkeventd.py | 7 ++++---
3 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/.werks/2774 b/.werks/2774
new file mode 100644
index 0000000..1d13277
--- /dev/null
+++ b/.werks/2774
@@ -0,0 +1,10 @@
+Title: Fix exception when deleting certain types of MIBs
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i4
+Date: 1446823549
+
+
diff --git a/ChangeLog b/ChangeLog
index 1ab4c03..7ab7699 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -86,6 +86,7 @@
* 2721 FIX: Fixed user profile sync in distributed environments after profile change
* 2723 FIX: Hiding "discard changes button" after successful activation of changes
* 2742 FIX: Make selection of folders and host group tag filter use nicer drawing characters
+ * 2774 FIX: Fix exception when deleting certain types of MIBs
Notifications:
* 2728 FIX: Removed debug notification script (was not executable)...
diff --git a/mkeventd/web/plugins/wato/mkeventd.py b/mkeventd/web/plugins/wato/mkeventd.py
index b7fc115..511b0d0 100644
--- a/mkeventd/web/plugins/wato/mkeventd.py
+++ b/mkeventd/web/plugins/wato/mkeventd.py
@@ -1938,9 +1938,10 @@ def parse_snmp_mib_header(path):
# read till first "OBJECT IDENTIFIER" declaration
head = ''
for line in file(path):
- if 'OBJECT IDENTIFIER' in line:
- break # seems the header is finished
- head += line
+ if not line.startswith("--"):
+ if 'OBJECT IDENTIFIER' in line:
+ break # seems the header is finished
+ head += line
# now try to extract some relevant information from the header