Module: check_mk
Branch: master
Commit: 8703cc3db4840b2c0f30de2b3001b31961020537
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8703cc3db4840b…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Oct 12 16:06:58 2012 +0200
Solaris agent: add <<<uptime>>> section (thanks to Daniel Roettgermann)
---
ChangeLog | 1 +
agents/check_mk_agent.solaris | 4 ++++
2 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index a035b55..00b131f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -59,6 +59,7 @@
counters if a base value is set
* Windows agent: output ullTotalVirtual and ullAvailVirtual (not yet
being used by check)
+ * Solaris agent: add <<<uptime>>> section (thanks to Daniel
Roettgermann)
1.2.0p3:
Mulitisite
diff --git a/agents/check_mk_agent.solaris b/agents/check_mk_agent.solaris
index 5cd24f2..36f0d3d 100755
--- a/agents/check_mk_agent.solaris
+++ b/agents/check_mk_agent.solaris
@@ -113,6 +113,10 @@ if [ -x /sbin/zpool ]; then
/sbin/zpool status -x
fi
+# Uptime compatible with Linux format (thanks to Daniel Roettgermann)
+echo '<<<uptime>>>'
+echo `expr \`nawk 'BEGIN{print srand()}'\` - \`kstat -p
unix:0:system_misc:boot_time |awk '{print $2}'\``
+
# NTP
# This will only work on Sol10 and above