Module: check_mk
Branch: master
Commit: de2167f37bdd1f04d2235f50736816ad47e82e4a
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=de2167f37bdd1f…
Author: Marcel Arentz <ma(a)mathias-kettner.de>
Date: Tue Apr 11 12:24:24 2017 +0200
4616 FIX mk_postgres/mk_db2.linux: Fixed quotes which lead into wrong interpretation
The double quotes in awk of the function compare_version_greater_euqal lead
into a bash interpreting of the $1 variable expansion. In consequence the
comparison between e.g. 9.0 and 7.3 resultet in a return 1. This misbehaviour
has been fixed now.
Change-Id: Ibf69d13979d691404d5bb4fdfa048304d18e3f1e
---
.werks/4616 | 13 +++++++++++++
agents/plugins/mk_db2.linux | 2 +-
agents/plugins/mk_postgres | 2 +-
3 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/.werks/4616 b/.werks/4616
new file mode 100644
index 0000000..cb7d4f0
--- /dev/null
+++ b/.werks/4616
@@ -0,0 +1,13 @@
+Title: mk_postgres/mk_db2.linux: Fixed quotes which lead into wrong interpretation
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1491906005
+Class: fix
+
+The double quotes in awk of the function compare_version_greater_euqal lead
+into a bash interpreting of the $1 variable expansion. In consequence the
+comparison between e.g. 9.0 and 7.3 resultet in a return 1. This misbehaviour
+has been fixed now.
diff --git a/agents/plugins/mk_db2.linux b/agents/plugins/mk_db2.linux
index cf1d0d5..3f5793b 100755
--- a/agents/plugins/mk_db2.linux
+++ b/agents/plugins/mk_db2.linux
@@ -70,7 +70,7 @@ function query_instances {
function compare_version_greater_equal {
- GREATER_ONE=\\\$(echo "\\\$1 \\\$2" | awk "{if (\\\$1 >=
\\\$2) print \\\$1; else print \\\$2}")
+ GREATER_ONE=\\\$(echo "\\\$1 \\\$2" | awk '{if (\\\$1 >=
\\\$2) print \\\$1; else print \\\$2}')
if [ \\\$GREATER_ONE == \\\$1 ] ; then
return 0
else
diff --git a/agents/plugins/mk_postgres b/agents/plugins/mk_postgres
index 77837d8..afb551c 100755
--- a/agents/plugins/mk_postgres
+++ b/agents/plugins/mk_postgres
@@ -33,7 +33,7 @@ else
fi
function compare_version_greater_equal() {
- GREATER_ONE=$(echo "$1 $2" | awk "{if ($1 >= $2) print $1; else
print $2}")
+ GREATER_ONE=$(echo "$1 $2" | awk '{if ($1 >= $2) print $1; else
print $2}')
if [ $GREATER_ONE == $1 ] ; then
return 0
else