New "Uptime" test to return the system uptime
authorAlexander Barton <alex@barton.de>
Mon, 14 Dec 2009 20:32:48 +0000 (21:32 +0100)
committerAlexander Barton <alex@barton.de>
Mon, 14 Dec 2009 20:32:48 +0000 (21:32 +0100)
Currently, this test always returns success and never any error ...

client/lib/tests/Uptime.tst [new file with mode: 0644]

diff --git a/client/lib/tests/Uptime.tst b/client/lib/tests/Uptime.tst
new file mode 100644 (file)
index 0000000..2484c8d
--- /dev/null
@@ -0,0 +1,11 @@
+# NagCollect -- Nagios Data Collector for Passive Checks
+# Copyright (c)2009 Alexander Barton, alex@barton.de
+
+SERVICE="Sys-Load_p"
+
+uptime=`LC_ALL=C uptime`
+uptime=${uptime%,*user*}
+uptime=${uptime##* up }
+
+STATUS=0
+TEXT="Uptime: $uptime"