summaryrefslogtreecommitdiffstats
path: root/retiolum
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2013-01-07 09:17:14 +0700
committermakefu <github@syntax-fehler.de>2013-01-07 09:17:14 +0700
commitd907a7aa781caac2a3086535f5ce997131170ca2 (patch)
tree3738bf31cd567dada4665bc46010de3e26fdc24e /retiolum
parent9a5edaac48e2461aa247204fbcea37d805bf38f0 (diff)
parent29d8a4e5061d66d0dfeda28a9012992c12a83ccd (diff)
Merge branch 'master' of github.com:krebscode/painload
Diffstat (limited to 'retiolum')
-rwxr-xr-xretiolum/scripts/adv_graphgen/all_the_graphs.sh3
-rwxr-xr-xretiolum/scripts/adv_graphgen/anonytize.sh2
-rwxr-xr-xretiolum/scripts/adv_graphgen/parse_tinc_stats.py5
-rwxr-xr-xretiolum/scripts/adv_graphgen/sanitize.sh2
-rwxr-xr-xretiolum/scripts/tinc_setup/new_install.sh9
5 files changed, 16 insertions, 5 deletions
diff --git a/retiolum/scripts/adv_graphgen/all_the_graphs.sh b/retiolum/scripts/adv_graphgen/all_the_graphs.sh
index 8aa0ab21..d3ce8f86 100755
--- a/retiolum/scripts/adv_graphgen/all_the_graphs.sh
+++ b/retiolum/scripts/adv_graphgen/all_the_graphs.sh
@@ -4,7 +4,8 @@
echo "`date` begin all graphs" >> /tmp/build_graph
cd $(dirname $(readlink -f $0))
PATH=$PATH:../../../util/bin/
- export LOG_FILE=/var/log/retiolum.log
+ export LOG_FILE=/var/log/syslog
+ export TINC_LEGACY=true
EXTERNAL_FOLDER=/var/www/euer.krebsco.de/graphs/retiolum
INTERNAL_FOLDER=/var/www/euer/graphs/retiolum
begin=`timer`
diff --git a/retiolum/scripts/adv_graphgen/anonytize.sh b/retiolum/scripts/adv_graphgen/anonytize.sh
index dec6e456..b31f4dbb 100755
--- a/retiolum/scripts/adv_graphgen/anonytize.sh
+++ b/retiolum/scripts/adv_graphgen/anonytize.sh
@@ -11,7 +11,7 @@ TYPE2=png
OPENER=/bin/true
DOTFILE=`mktemp`
trap 'rm $DOTFILE' INT TERM
-sudo LOG_FILE=$LOG_FILE python ../../tinc_stats2json |\
+sudo -E python tinc_stats2json |\
python parse_tinc_anon.py> $DOTFILE
diff --git a/retiolum/scripts/adv_graphgen/parse_tinc_stats.py b/retiolum/scripts/adv_graphgen/parse_tinc_stats.py
index 8371ad3d..03a20214 100755
--- a/retiolum/scripts/adv_graphgen/parse_tinc_stats.py
+++ b/retiolum/scripts/adv_graphgen/parse_tinc_stats.py
@@ -18,12 +18,12 @@ except Exception as e:
sys.stderr.write("Cannot connect to graphite: %s\n" % str(e))
supernodes= [ ]
-#supernodes= [ "kaah","supernode","euer","pa_sharepoint","oxberg" ]
for supernode,addr in check_super():
supernodes.append(supernode)
""" TODO: Refactoring needed to pull the edges out of the node structures again,
it should be easier to handle both structures"""
DUMP_FILE = "/krebs/db/availability"
+
def write_digraph(nodes):
"""
writes the complete digraph in dot format
@@ -173,6 +173,9 @@ def write_node(k,v):
node +="\""
if k in supernodes:
node += ",fillcolor=steelblue1"
+ # warning if node only has one connection
+ elif v['num_conns'] == 1:
+ node += ",fillcolor=red"
#node +=",group=\""+v['external-ip'].replace(".","")+"\""
node += "]"
print node
diff --git a/retiolum/scripts/adv_graphgen/sanitize.sh b/retiolum/scripts/adv_graphgen/sanitize.sh
index 78d74ce6..45d29a22 100755
--- a/retiolum/scripts/adv_graphgen/sanitize.sh
+++ b/retiolum/scripts/adv_graphgen/sanitize.sh
@@ -11,7 +11,7 @@ TYPE2=png
OPENER=/bin/true
DOTFILE=`mktemp`
trap 'rm $DOTFILE' INT TERM
-sudo LOG_FILE=$LOG_FILE python ../../tinc_stats2json |\
+sudo -E python tinc_stats2json |\
python parse_tinc_stats.py > $DOTFILE
diff --git a/retiolum/scripts/tinc_setup/new_install.sh b/retiolum/scripts/tinc_setup/new_install.sh
index 1d16cfb9..410dce62 100755
--- a/retiolum/scripts/tinc_setup/new_install.sh
+++ b/retiolum/scripts/tinc_setup/new_install.sh
@@ -12,7 +12,14 @@ SUBNET4=${SUBNET4:-10.243}
SUBNET6=${SUBNET6:-42}
TEMPDIR=${TEMPDIR:-auto}
TINCDIR=${TINCDIR:-auto}
-SYSHOSTN=${HOSTNAME:-$(hostname)}
+
+if type hostname >/dev/null ;then SYSHOSTN=${HOSTNAME:-$(hostname)}
+elif type uci >/dev/null ;then SYSHOSTN=$(uci get system.@system[0].hostname)
+elif [ -e /etc/hostname ] ;then SYSHOSTN=$(cat /etc/hostname)
+else SYSHOSTN="unknown"
+fi
+
+#overwrite `found` hostname
HOSTN=${HOSTN:-$SYSHOSTN}
NETNAME=${NETNAME:-retiolum}
MASK4=${MASK4:-16}