Module: check_mk
Branch: master
Commit: 1c1b0db728895db11214d72b17531f7cbb746e9e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1c1b0db728895d…
Author: Marcel Schulte <ms(a)mathias-kettner.de>
Date: Wed Jun 14 10:32:24 2017 +0200
4858 FIX omd_apache data collection: fixed issues caused by missing newline at the end of
statsfile(s)
Sometimes the apache statsfile(s) can miss a newline at the end of the file. This caused
the following known issues:
* missing agent section directly after omd_apache section - because the section header was
starting in the same line as the omd_apache section's last line
* crashed omd_apache check because of missing data
---
.werks/4858 | 13 +++++++++++++
agents/check_mk_agent.linux | 2 ++
2 files changed, 15 insertions(+)
diff --git a/.werks/4858 b/.werks/4858
new file mode 100644
index 0000000..e70d2de
--- /dev/null
+++ b/.werks/4858
@@ -0,0 +1,13 @@
+Title: omd_apache data collection: fixed issues caused by missing newline at the end of
statsfile(s)
+Level: 2
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1497428804
+Class: fix
+
+Sometimes the apache statsfile(s) can miss a newline at the end of the file. This caused
the following known issues:
+
+* missing agent section directly after omd_apache section - because the section header
was starting in the same line as the omd_apache section's last line
+* crashed omd_apache check because of missing data
diff --git a/agents/check_mk_agent.linux b/agents/check_mk_agent.linux
index 00b4d00..ba6cee1 100755
--- a/agents/check_mk_agent.linux
+++ b/agents/check_mk_agent.linux
@@ -744,6 +744,8 @@ then
echo "[$site]"
cat $statsfile
$statsfile
+ # prevent next section
to fail caused by a missing newline at the end of the statsfile
+ echo
fi
done
fi