diff options
author | makefu <github@syntax-fehler.de> | 2012-11-22 18:26:33 +0100 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2012-11-22 18:26:33 +0100 |
commit | 431afde0bfcbbccb4c7dad0cece3552384ba2862 (patch) | |
tree | 4f2584267ca28a4af74af6a5666f4542b12cf944 | |
parent | ba4faba47f74c9258f0748af7720150ab757c7dc (diff) |
retiolum: add find_super
script finds potential supernodes based on the open tinc port.
if a dedicated port is added, the script will fail to produce correct output but it gives a good overview of the current supernode constellation
-rw-r--r-- | retiolum/scripts/adv_graphgen/find_super | 14 | ||||
-rw-r--r-- | temper/Makefile | 8 | ||||
-rwxr-xr-x | temper/collectd-temper.sh | 9 |
3 files changed, 28 insertions, 3 deletions
diff --git a/retiolum/scripts/adv_graphgen/find_super b/retiolum/scripts/adv_graphgen/find_super new file mode 100644 index 00000000..c89a94fb --- /dev/null +++ b/retiolum/scripts/adv_graphgen/find_super @@ -0,0 +1,14 @@ +#!/bin/sh +cd /etc/tinc/retiolum/hosts +ls -1 . | while read fname; +do + for i in `sed -n 's/Address\s*=\s*\(.*\)/\1/p' $fname`;do + if nc -zw 5 $i 655 2>/dev/null; then + echo "$fname - $i reachable" + #else + #echo -n + #echo "$fname - $i unreachable" + + fi + done +done 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 |