]> arthur.barton.de Git - nagcollect.git/commitdiff
Move client-side test scripts to client/lib/tests
authorAlexander Barton <alex@barton.de>
Mon, 14 Dec 2009 00:22:46 +0000 (01:22 +0100)
committerAlexander Barton <alex@barton.de>
Mon, 14 Dec 2009 00:22:46 +0000 (01:22 +0100)
Makefile
client/lib/Sys-Load.tst [deleted file]
client/lib/tests/Sys-Load.tst [new file with mode: 0644]

index c757d38db08f9e95aba482df074f4f2e8c9c911b..3ef6ac57313742c09d275c404ee7808989439575 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -35,7 +35,7 @@ install-client:
         install -o 0 -g 0 -m 600 -p \
                client/etc/nagcollect.conf /usr/local/etc/nagcollect.conf
        install -d -o 0 -g 0 -m 755 /usr/local/lib/nagcollect
         install -o 0 -g 0 -m 600 -p \
                client/etc/nagcollect.conf /usr/local/etc/nagcollect.conf
        install -d -o 0 -g 0 -m 755 /usr/local/lib/nagcollect
-       (cd client/lib; find . -name '*.tst' | \
+       (cd client/lib/tests; find . -name '*.tst' | \
         while read x; do \
          install -d -o 0 -g 0 -m 755 `dirname "/usr/local/lib/nagcollect/$$x"`; \
          install -o 0 -g 0 -m 644 "$$x" "/usr/local/lib/nagcollect/$$x"; \
         while read x; do \
          install -d -o 0 -g 0 -m 755 `dirname "/usr/local/lib/nagcollect/$$x"`; \
          install -o 0 -g 0 -m 644 "$$x" "/usr/local/lib/nagcollect/$$x"; \
@@ -43,7 +43,7 @@ install-client:
        )
 
 nagcollecttestscripts:
        )
 
 nagcollecttestscripts:
-       tar -czvf nagcollecttestscripts.tgz -C client/lib .
+       tar -czvf nagcollecttestscripts.tgz -C client/lib/tests .
 
 .PHONY: all install install-all install-server install-client \
        nagcollecttestscripts
 
 .PHONY: all install install-all install-server install-client \
        nagcollecttestscripts
diff --git a/client/lib/Sys-Load.tst b/client/lib/Sys-Load.tst
deleted file mode 100644 (file)
index c731f4b..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-# NagCollect -- Nagios Data Collector for Passive Checks
-# Copyright (c)2009 Alexander Barton, alex@barton.de
-
-SERVICE="Sys-Load_p"
-
-uptime=`LC_ALL=C uptime`
-load=${uptime##*:}
-
-load01=`echo $load | cut -d' ' -f1 | cut -d'.' -f1`
-load05=`echo $load | cut -d' ' -f2 | cut -d'.' -f1`
-load15=`echo $load | cut -d' ' -f3 | cut -d'.' -f1`
-
-if [ $load01 -ge 8 -o $load05 -ge 6 -o $load15 -ge 3 ]; then
-       STATUS=2
-       TEXT="ERROR - Load average: $load"
-elif [ $load01 -ge 4 -o $load05 -ge 3 -o $load15 -ge 1 ]; then
-       STATUS=1
-       TEXT="WARNING - Load average: $load"
-else
-       STATUS=0
-       TEXT="OK - Load average: $load"
-fi
\ No newline at end of file
diff --git a/client/lib/tests/Sys-Load.tst b/client/lib/tests/Sys-Load.tst
new file mode 100644 (file)
index 0000000..c731f4b
--- /dev/null
@@ -0,0 +1,22 @@
+# NagCollect -- Nagios Data Collector for Passive Checks
+# Copyright (c)2009 Alexander Barton, alex@barton.de
+
+SERVICE="Sys-Load_p"
+
+uptime=`LC_ALL=C uptime`
+load=${uptime##*:}
+
+load01=`echo $load | cut -d' ' -f1 | cut -d'.' -f1`
+load05=`echo $load | cut -d' ' -f2 | cut -d'.' -f1`
+load15=`echo $load | cut -d' ' -f3 | cut -d'.' -f1`
+
+if [ $load01 -ge 8 -o $load05 -ge 6 -o $load15 -ge 3 ]; then
+       STATUS=2
+       TEXT="ERROR - Load average: $load"
+elif [ $load01 -ge 4 -o $load05 -ge 3 -o $load15 -ge 1 ]; then
+       STATUS=1
+       TEXT="WARNING - Load average: $load"
+else
+       STATUS=0
+       TEXT="OK - Load average: $load"
+fi
\ No newline at end of file