Module: check_mk
Branch: master
Commit: 6495b9efdff811c29302971edb5e7c0f8b9f73bc
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6495b9efdff811…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Thu Aug 27 08:05:52 2015 +0200
added different uptime formats as comments
---
agents/check_mk_agent.aix | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/agents/check_mk_agent.aix b/agents/check_mk_agent.aix
index c3927fd..2ebb4f4 100755
--- a/agents/check_mk_agent.aix
+++ b/agents/check_mk_agent.aix
@@ -216,9 +216,19 @@ then
$(which trd) -s
fi
-
+# uptime formats
+# 12:55pm up 105 days, 21 hrs, 2 users, load average: 0.26, 0.26, 0.26
+# 1:41pm up 105 days, 21:46, 2 users, load average: 0.28, 0.28, 0.27
+# 05:26PM up 1:16, 1 user, load average: 0.33, 0.21, 0.20
+# 06:13PM up 2:03, 1 user, load average: 1.16, 1.07, 0.91
+# 08:43AM up 29 mins, 1 user, load average: 0.09, 0.18, 0.21
+# 08:47AM up 66 days, 18:34, 1 user, load average: 2.25, 2.43, 2.61
echo '<<<uptime>>>'
-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)}'
+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