summaryrefslogtreecommitdiffstats
path: root/temper
diff options
context:
space:
mode:
authoreuer <root@euer.krebsco.de>2012-11-28 09:48:06 +0100
committereuer <root@euer.krebsco.de>2012-11-28 09:48:06 +0100
commitf629c9e0c216150ef8f5c868eacd10507846d766 (patch)
treec14ec730917994d1d9dcab8501fa2a87022a5346 /temper
parent50d63b50779bca78978d5ac1049604a4c6d37c69 (diff)
parent105cff1f36a13e76013309e928a2704bdea2de7e (diff)
Merge branch 'master' of github.com:krebscode/painload
Diffstat (limited to 'temper')
-rw-r--r--temper/Makefile8
-rwxr-xr-xtemper/collectd-temper.sh9
2 files changed, 14 insertions, 3 deletions
diff --git a/temper/Makefile b/temper/Makefile
index 79dc3216..80c0206f 100644
--- a/temper/Makefile
+++ b/temper/Makefile
@@ -1,15 +1,17 @@
all: infest
-infest: temper
+infest: temper rules-install
CFLAGS = -O2 -Wall
-temper: temper.c rules-install
+temper: temper.c
${CC} -DUNIT_TEST -o $@ $^ -lusb
chmod +s temper
cp -a temper /usr/bin
clean:
rm -f temper *.o
-rules-install: # must be superuser to do this
+
+rules-install: /etc/udev/rules.d/99-tempsensor.rules
+/etc/udev/rules.d/99-tempsensor.rules:
cp 99-tempsensor.rules /etc/udev/rules.d
debian-prereq:
apt-get install libusb-dev
diff --git a/temper/collectd-temper.sh b/temper/collectd-temper.sh
new file mode 100755
index 00000000..f66e9acc
--- /dev/null
+++ b/temper/collectd-temper.sh
@@ -0,0 +1,9 @@
+HOSTNAME="${COLLECTD_HOSTNAME:-localhost}"
+INTERVAL="${COLLECTD_INTERVAL:-30}"
+TEMPERNAME="${TEMPERNAME:-external}"
+TEMPERBIN="${TEMPERBIN:-/krebs/temper/temper}"
+#while sleep "$INTERVAL"; do
+ VALUE=`$TEMPERBIN`
+ echo "PUTVAL \"$HOSTNAME/sensors-temper/temperature-$TEMPERNAME\" N:$VALUE" #interval=$INTERVAL
+ logger "PUTVAL \"$HOSTNAME/sensors-temper/temperature-$TEMPERNAME\" N:$VALUE" #interval=$INTERVAL
+#done