Module: check_mk
Branch: master
Commit: 3d0b294ecf22e458d9be5c7c6856f7d8409c9e58
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3d0b294ecf22e4…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Aug 25 13:33:39 2016 +0200
3765 FIX oracle_asm_diskgroup: Made check more robust against invalid data received from
agent
It may happen, at least with older version of the agent plugin, that the help text of
SQLPlus
is sent in the agent sections. This could lead to ~50 services being created by accident.
The
changed check now ignores these unexpected lines from the agent and only processes lines
which
match the known format.
---
.werks/3765 | 13 +++++++++++++
ChangeLog | 1 +
checks/oracle_asm_diskgroup | 9 ++++++---
3 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/.werks/3765 b/.werks/3765
new file mode 100644
index 0000000..3dd9e99
--- /dev/null
+++ b/.werks/3765
@@ -0,0 +1,13 @@
+Title: oracle_asm_diskgroup: Made check more robust against invalid data received from
agent
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.4.0i1
+Date: 1472124723
+
+It may happen, at least with older version of the agent plugin, that the help text of
SQLPlus
+is sent in the agent sections. This could lead to ~50 services being created by accident.
The
+changed check now ignores these unexpected lines from the agent and only processes lines
which
+match the known format.
diff --git a/ChangeLog b/ChangeLog
index bf35bd5..4f4d3cb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -351,6 +351,7 @@
* 3774 FIX: apc_symmetra: fixed wrong status and values handling
* 3761 FIX: windows_tasks: Fixed possible exception in discovery in case of
unexpected agent data
* 3762 FIX: local: Fixed long output handling with Microcore...
+ * 3765 FIX: oracle_asm_diskgroup: Made check more robust against invalid data
received from agent...
Multisite:
* 3187 notification view: new filter for log command via regex
diff --git a/checks/oracle_asm_diskgroup b/checks/oracle_asm_diskgroup
index c2516ab..3a74d31 100644
--- a/checks/oracle_asm_diskgroup
+++ b/checks/oracle_asm_diskgroup
@@ -41,10 +41,10 @@ factory_settings["asm_diskgroup_default_levels"] = {
}
def inventory_oracle_asm_diskgroup(info):
- return [ (line[-1].rstrip("/"), {}) for line in info ]
+ return [ (line[-1].rstrip("/"), {}) for line in info
+ if len(line) in [ 12, 13 ] and line[0] in [ "MOUNTED",
"DISMOUNTED" ] ]
def check_oracle_asm_diskgroup(item, params, info):
-
for line in info:
voting_files = 'N'
@@ -57,7 +57,10 @@ def check_oracle_asm_diskgroup(item, params, info):
free_mb, req_mir_free_mb, usable_file_mb, offline_disks, \
name = line
else:
- name = ""
+ continue # Invalid data, skip this line
+
+ if state not in [ "MOUNTED", "DISMOUNTED" ]:
+ continue # Invalid data, skip this line
dg_name = name.rstrip('/')