Module: check_mk
Branch: master
Commit: ba419ba35acf5643ab347cf9123f40088a74a8c5
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ba419ba35acf56…
Author: Marcel Arentz <ma(a)mathias-kettner.de>
Date: Mon Feb 5 13:28:08 2018 +0100
5557 FIX check_mk_agent.aix: Fixed bug in uptime because AIX is not able to interpret ?
and + in regexes
Change-Id: Iff383e739f31d9d9a58f9d4412257cf25ce32683
---
.werks/5557 | 10 ++++++++++
agents/check_mk_agent.aix | 10 +++++-----
2 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/.werks/5557 b/.werks/5557
new file mode 100644
index 0000000..6e47329
--- /dev/null
+++ b/.werks/5557
@@ -0,0 +1,10 @@
+Title: check_mk_agent.aix: Fixed bug in uptime because AIX is not able to interpret ? and
+ in regexes
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.5.0i3
+Date: 1517833562
+Class: fix
+
+
diff --git a/agents/check_mk_agent.aix b/agents/check_mk_agent.aix
index ef7db0d..89167b5 100755
--- a/agents/check_mk_agent.aix
+++ b/agents/check_mk_agent.aix
@@ -243,20 +243,20 @@ fi
echo '<<<uptime>>>'
UPTIME=$(uptime | sed -e 's/^.*up//g' -e 's/[0-9]* user.*//g')
case $UPTIME in
- *day* ) DAYS=$(echo $UPTIME | sed -e 's/days\?,.*//g') ;;
+ *day* ) DAYS=$(echo $UPTIME | sed -e 's/days\{0,1\},.*//g') ;;
* ) DAYS="0" ;;
esac
case $UPTIME in
*:* )
- HOURS=$(echo $UPTIME | sed -e 's/.*days\?,//g' -e 's/:.*//g')
- MINS=$(echo $UPTIME | sed -e 's/.*days\?,//g' -e 's/.*://g' -e
's/,.*//g') ;;
+ HOURS=$(echo $UPTIME | sed -e 's/.*days\{0,1\},//g' -e
's/:.*//g')
+ MINS=$(echo $UPTIME | sed -e 's/.*days\{0,1\},//g' -e 's/.*://g'
-e 's/,.*//g') ;;
*hr* )
- HOURS=$(echo $UPTIME | sed -e 's/hrs\?,.*//g' -e 's/.*,//g')
+ HOURS=$(echo $UPTIME | sed -e 's/hrs\{0,1\},.*//g' -e
's/.*,//g')
MINS=0 ;;
*min* )
HOURS=0
- MINS=$(echo $UPTIME | sed -e 's/mins\?,.*//g' -e 's/.*hrs\?,//g'
-e 's/.*days\?,//g') ;;
+ MINS=$(echo $UPTIME | sed -e 's/mins\{0,1\},.*//g' -e
's/.*hrs\{0,1\},//g' -e 's/.*days\{0,1\},//g') ;;
* )
HOURS="0"
MINS=0 ;;