diff options
author | makefu <github@syntax-fehler.de> | 2013-04-29 13:39:54 +0200 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2013-04-29 13:39:54 +0200 |
commit | b0273180da89e11cd6a7346ed1a72e9f17fbf230 (patch) | |
tree | b4dbfa157032ce5168099a552d0280764cbb505f /retiolum/scripts/adv_graphgen/parse_tinc_stats.py | |
parent | 5266540d4c21494adbac3f25f982f2bf32390734 (diff) | |
parent | 5d904ef7620cda3355b601793441fc804ff506a9 (diff) |
Merge branch 'master' of github.com:krebscode/painload
Diffstat (limited to 'retiolum/scripts/adv_graphgen/parse_tinc_stats.py')
-rwxr-xr-x | retiolum/scripts/adv_graphgen/parse_tinc_stats.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/retiolum/scripts/adv_graphgen/parse_tinc_stats.py b/retiolum/scripts/adv_graphgen/parse_tinc_stats.py index e5bd96a8..e6a67e2c 100755 --- a/retiolum/scripts/adv_graphgen/parse_tinc_stats.py +++ b/retiolum/scripts/adv_graphgen/parse_tinc_stats.py @@ -54,6 +54,7 @@ def write_stat_node(nodes): ''' Write a `stats` node in the corner This node contains infos about the current number of active nodes and connections inside the network ''' + from time import localtime,strftime num_conns = 0 num_nodes = len(nodes) try: @@ -64,6 +65,7 @@ def write_stat_node(nodes): for k,v in nodes.iteritems(): num_conns+= len(v['to']) node_text = " stats_node [label=\"Statistics\\l" + node_text += "Build Date : %s\\l" % strftime("%Y-%m-%d %H:%M:%S",localtime()) node_text += "Active Nodes: %s\\l" % num_nodes node_text += "Connections : %s\\l" % num_conns node_text += "\"" @@ -172,8 +174,8 @@ def write_node(k,v): if v.has_key('num_conns'): node += "Num Connects:"+str(v['num_conns'])+"\\l" node += "external:"+v['external-ip']+":"+v['external-port']+"\\l" - for addr in v.get('internal-ip',['¯\\\\(°_o)/¯']): - node += "internal:"+addr+"\\l" + for addr in v.get('internal-ip',['dunno lol']): #['¯\\\\(°_o)/¯']): + node += "internal:%s\\l"%addr node +="\"" # warning if node only has one connection |