summaryrefslogtreecommitdiffstats
path: root/retiolum/scripts/adv_graphgen/parse_tinc_stats.py
diff options
context:
space:
mode:
authormakefu <root@pigstarter.de>2013-01-06 04:40:20 +0000
committermakefu <root@pigstarter.de>2013-01-06 04:40:20 +0000
commit29d8a4e5061d66d0dfeda28a9012992c12a83ccd (patch)
treed210f5d9b35afd5a129f0ed6da448920a4e1ec75 /retiolum/scripts/adv_graphgen/parse_tinc_stats.py
parent7f97a33b1a8c427f29eab3a015df6581bb6bab36 (diff)
adv_graphgen: add visual warning
for nodes with only one connection as this means no redundancy is configured in case the other connected node dies away
Diffstat (limited to 'retiolum/scripts/adv_graphgen/parse_tinc_stats.py')
-rwxr-xr-xretiolum/scripts/adv_graphgen/parse_tinc_stats.py5
1 files changed, 4 insertions, 1 deletions
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