Module: check_mk
Branch: master
Commit: 165d46f91dec03d26eb7d2adf29a5644c0632369
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=165d46f91dec03…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Wed Aug 26 16:00:58 2015 +0200
#2522 FIX check_mk_agent.aix: now handles different output formats of the uptime function
---
.werks/2522 | 9 +++++++++
ChangeLog | 1 +
agents/check_mk_agent.aix | 2 +-
3 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/.werks/2522 b/.werks/2522
new file mode 100644
index 0000000..265fe3c
--- /dev/null
+++ b/.werks/2522
@@ -0,0 +1,9 @@
+Title: check_mk_agent.aix: now handles different output formats of the uptime function
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i3
+Date: 1440597462
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index 4b8d591..80a2192 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -134,6 +134,7 @@
* 1280 FIX: check_mail_loop: It was not possible to use POP3 as protocol to fetch
mails
* 1282 FIX: win_printers: Not longer discover offline printers
* 1284 FIX: symantec_av_progstate: Now Supports the current version of Symantec AV
+ * 2522 FIX: check_mk_agent.aix: now handles different output formats of the uptime
function
Multisite:
* 2385 SEC: Fixed possible reflected XSS on all GUI pages where users can produce
unhandled exceptions...
diff --git a/agents/check_mk_agent.aix b/agents/check_mk_agent.aix
index 92238ff..c3927fd 100755
--- a/agents/check_mk_agent.aix
+++ b/agents/check_mk_agent.aix
@@ -218,7 +218,7 @@ fi
echo '<<<uptime>>>'
-uptime | awk '{print $3,$5}' | tr ":" " " | sed
's/,//' | awk
'{a=86400*int($1)+3600*int($2)+60*int($3);printf("%d\n",a)}'
+uptime | sed -e 's/^.*up//g' -e 's/user.*$//g' -e 's/hrs/0/g' -e
's/:/ /g' -e 's/days,//g' -e 's/mins//g' | sed -r
's/(.*),.*/\1/' | awk '{if (NF == 3) a=86400*int($1)+3600*int($2)+60*int($3);
else if (NF ==2) a=3600*int($1)+60*int($2); else a=60*int($1);
printf("%d\n",a)}'
if cd $PLUGINSDIR 2>/dev/null