From 95f1c89ed9e9717f6bfdf243e1f630af9d1d515c Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 11 Aug 2014 23:16:37 +0200 Subject: update init hosts --- retiolum/scripts/tinc_setup/new_install.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'retiolum/scripts') diff --git a/retiolum/scripts/tinc_setup/new_install.sh b/retiolum/scripts/tinc_setup/new_install.sh index 87c20e57..a788da13 100755 --- a/retiolum/scripts/tinc_setup/new_install.sh +++ b/retiolum/scripts/tinc_setup/new_install.sh @@ -203,7 +203,9 @@ AutoConnect = 3 #ConnectTos ConnectTo = fastpoke ConnectTo = pigstarter -ConnectTo = kheurop +ConnectTo = reimae +ConnectTo = ire +ConnectTo = tahoe EOF host2subnet $MASK4 -- cgit v1.2.3 From f7174934c031e6aa547fbc565b4898fc58c8d5df Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 12 Aug 2014 16:48:43 +0200 Subject: tinc_stats: add Services description to graph --- retiolum/scripts/adv_graphgen/tinc_stats/Graph.py | 43 ++++++++++++++++++---- .../scripts/adv_graphgen/tinc_stats/Services.py | 17 +++++++++ .../scripts/adv_graphgen/tinc_stats/__init__.py | 1 + 3 files changed, 54 insertions(+), 7 deletions(-) create mode 100644 retiolum/scripts/adv_graphgen/tinc_stats/Services.py (limited to 'retiolum/scripts') diff --git a/retiolum/scripts/adv_graphgen/tinc_stats/Graph.py b/retiolum/scripts/adv_graphgen/tinc_stats/Graph.py index 9d80e62d..2fb09a58 100755 --- a/retiolum/scripts/adv_graphgen/tinc_stats/Graph.py +++ b/retiolum/scripts/adv_graphgen/tinc_stats/Graph.py @@ -2,6 +2,7 @@ from BackwardsReader import BackwardsReader import sys,json,os from Supernodes import check_all_the_super +from Services import add_services from Availability import get_node_availability import sys,json from time import time @@ -128,21 +129,46 @@ def print_node(k,v): tinc """ - node = " "+k+"[label=\"" - node += k+"\\l" - node += "availability: %f\\l" % v['availability'] + node = " "+k+"[label=<" %k + node += ""%k + if 'availability' in v: + node += "" % v['availability'] + if 'num_conns' in v: - node += "Num Connects:"+str(v['num_conns'])+"\\l" - node += "external:"+v['external-ip']+":"+v['external-port']+"\\l" + node += ""%str(v['num_conns']) + + node += "" for addr in v.get('internal-ip',['dunno lol']): - node += "internal:%s\\l"%addr - node +="\"" + node += ""%addr + + if 'services' in v: + node +="" + for service in v['services']: + try:uri,comment = service.split(" ",1) + except: + uri = service + comment ="" + node +="" + uri_proto=uri.split(":")[0] + uri_rest = uri.split(":")[1] + if not uri_rest: + node +="" + # end label + node +="
%s
availability:%f
Num Connects:%s
external:"+v['external-ip']+":"+v['external-port']+"
internal:%s
Services:
{0}".format(uri) + else: + node +="{0}".format(uri) + if comment: + node += "
{0}".format(comment) + node +="
>" if v['num_conns'] == 1: node += ",fillcolor=red" elif k in supernodes: node += ",fillcolor=steelblue1" node += "]" + print(node) def print_anonymous_node(k,v): @@ -206,7 +232,9 @@ if __name__ == "__main__": elif sys.argv[1] == "complete": for supernode,addr in check_all_the_super(): supernodes.append(supernode) + generate_availability_stats(nodes) + add_services(nodes) for k,v in nodes.items(): print_node(k,v) print_edge(k,v) @@ -219,3 +247,4 @@ if __name__ == "__main__": print_stat_node(nodes) print ('}') +# vim: set sw=2:ts=2 diff --git a/retiolum/scripts/adv_graphgen/tinc_stats/Services.py b/retiolum/scripts/adv_graphgen/tinc_stats/Services.py new file mode 100644 index 00000000..6752e116 --- /dev/null +++ b/retiolum/scripts/adv_graphgen/tinc_stats/Services.py @@ -0,0 +1,17 @@ +services_dir="/home/makefu/r/services" +def add_services(nodes): + for k,v in nodes.items(): + n = nodes[k] + try: + with open("{0}/{1}".format(services_dir,k)) as f: + n["services"] = [] + for line in f.readlines(): + n["services"].append(line.strip()) + except Exception as e: + n["services"] = ["Error: No Service File!"] + return nodes +if __name__ == "__main__": + import json,sys + nodes = add_services(json.load(sys.stdin)) + print (json.dumps(nodes,indent=4)) +# vim: set expandtab:ts=4:sw=4 diff --git a/retiolum/scripts/adv_graphgen/tinc_stats/__init__.py b/retiolum/scripts/adv_graphgen/tinc_stats/__init__.py index 62f541d1..f0fc8520 100644 --- a/retiolum/scripts/adv_graphgen/tinc_stats/__init__.py +++ b/retiolum/scripts/adv_graphgen/tinc_stats/__init__.py @@ -4,3 +4,4 @@ import Log2JSON import Supernodes import Geo import Graph +import Services -- cgit v1.2.3