Module: check_mk
Branch: master
Commit: 3a43c8b18f3c5514de7f7e14e6a33f88af2463d3
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3a43c8b18f3c55…
Author: Moritz Kiemer <mo(a)mathias-kettner.de>
Date: Wed Mar 20 13:03:17 2019 +0100
7219 FIX agent_vsphere: Missing data in case of mutliline snapshot description
In case a description of a VM snapshot consisted of multiple lines, no
data about the corresponding VM has been obtained.
Change-Id: Ia493747d27a2f368fb3df005bb02acfb06821533
---
.werks/7219 | 12 ++++++++++++
agents/special/agent_vsphere | 5 +----
2 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/.werks/7219 b/.werks/7219
new file mode 100644
index 0000000..f6a015f
--- /dev/null
+++ b/.werks/7219
@@ -0,0 +1,12 @@
+Title: agent_vsphere: Missing data in case of mutliline snapshot description
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1553083211
+
+In case a description of a VM snapshot consisted of multiple lines, no
+data about the corresponding VM has been obtained.
diff --git a/agents/special/agent_vsphere b/agents/special/agent_vsphere
index 68e9e94..81a5c8c 100755
--- a/agents/special/agent_vsphere
+++ b/agents/special/agent_vsphere
@@ -906,10 +906,7 @@ def create_search_pattern(tokens):
def get_pattern(pattern, line):
- if not line:
- return []
- p = re.compile(pattern, re.MULTILINE)
- return p.findall(line)
+ return re.findall(pattern, line, re.DOTALL) if line else []
# TODO: Refactor to requests