diff options
-rwxr-xr-x | retiolum/bin/find-active-nodes | 21 | ||||
-rw-r--r-- | retiolum/hosts/Lassulus | 1 | ||||
-rw-r--r-- | retiolum/hosts/alarmpi | 11 | ||||
-rw-r--r-- | retiolum/hosts/alphalabs | 1 | ||||
-rw-r--r-- | retiolum/hosts/krebsplug_696c98da | 10 | ||||
-rw-r--r-- | retiolum/hosts/ohz | 10 | ||||
-rw-r--r-- | retiolum/hosts/pigstarter | 2 | ||||
-rw-r--r-- | retiolum/hosts/shabruecke_a0e95c28 | 12 | ||||
-rw-r--r-- | retiolum/scripts/adv_graphgen/find-all-nodes.py | 59 | ||||
-rwxr-xr-x | util/bin/graphitec | 5 |
10 files changed, 129 insertions, 3 deletions
diff --git a/retiolum/bin/find-active-nodes b/retiolum/bin/find-active-nodes new file mode 100755 index 00000000..2c316d0e --- /dev/null +++ b/retiolum/bin/find-active-nodes @@ -0,0 +1,21 @@ +#! /bin/dash +set -eu +cd /etc/tinc/retiolum/hosts +for name in ` + grep '^[[:space:]]*Address[[:space:]]*=' * | + cut -d: -f1 | sort | uniq +`; do + if eval "`sed -n ' + s/[[:space:]]\+//g + s/^\(Address\|Port\)=\(.*\)/\1="\${\1+\$\1\n}\2"/p + ' $name`"; then + port=${Port-655} + for host in $Address; do + if nc -zw 2 $host $port 2>/dev/null; then + echo "$name [('$host', $port)]" + fi & + done + wait + fi & +done +wait diff --git a/retiolum/hosts/Lassulus b/retiolum/hosts/Lassulus index 98bd01e0..be9782b1 100644 --- a/retiolum/hosts/Lassulus +++ b/retiolum/hosts/Lassulus @@ -1,6 +1,5 @@ Subnet = 42:0:0:0:0:0:0:dea7/128 Subnet = 10.243.0.2/32 -Compression = 9 -----BEGIN RSA PUBLIC KEY----- MIIBCgKCAQEAsj1PCibKOfF68gmFQ+wwyfhUWpqKqpznrJX1dZ+daae7l7nBHvsE H0QwkiMmk3aZy1beq3quM6gX13aT+/wMfWnLyuvT11T5C9JEf/IS91STpM2BRN+R diff --git a/retiolum/hosts/alarmpi b/retiolum/hosts/alarmpi new file mode 100644 index 00000000..205b0d83 --- /dev/null +++ b/retiolum/hosts/alarmpi @@ -0,0 +1,11 @@ +Subnet = 10.243.124.187 +Subnet = 42:2de9:fab6:7460:2fee:9199:fa1d:70ea + +-----BEGIN RSA PUBLIC KEY----- +MIIBCgKCAQEAunQOFP1mnEmsmnMYjCwbWdbGe0/hHQs2bxIdwO1RXngXgw/TBBhN +Xlp75LzPiT0ELF5WBPVclqskT+bl+FOOITH9XDkYzm22jzeLHq3bs3YiZhwzidkO +Xhq5pwGY4HL4o3SfFtfOHse688qqLXefoc9CfyAIKMCRRAxlzpqNVuZEg1eUcuUJ +z6gugJj+YyA4V3JGq7GuJDiPPOMrGel0rITMlWtYYtm0jf6deYBPjo+ZogDESlez +tBmPKNCXynSxb6cV39StUsbUQbLvHgPBrA01T+Hw1DV5eHmWoycvD4IfJqXdfMbc +BOqRHOlErXGTG5m2EUoU0VSj75zl06gW6wIDAQAB +-----END RSA PUBLIC KEY----- diff --git a/retiolum/hosts/alphalabs b/retiolum/hosts/alphalabs index a2e1032c..e5f98d69 100644 --- a/retiolum/hosts/alphalabs +++ b/retiolum/hosts/alphalabs @@ -1,6 +1,5 @@ Subnet = 42:0:0:0:0:0:0:a1fa/128 Subnet = 10.243.1.10/32 -Compression = 9 -----BEGIN RSA PUBLIC KEY----- MIIBCgKCAQEAvUAbMmmOFn+4kOvJAvmi0R/XCQa1YBlkjUvC6Pmt0Q8gV1DodXjB DgwP8yhLcxaVy2Hk82aJvNTUrfMeB2sdt1RJHQiEPQkHthdp8Spm0Px4uTiMjmFB diff --git a/retiolum/hosts/krebsplug_696c98da b/retiolum/hosts/krebsplug_696c98da new file mode 100644 index 00000000..6ae73323 --- /dev/null +++ b/retiolum/hosts/krebsplug_696c98da @@ -0,0 +1,10 @@ +Subnet = 10.243.217.22 +Subnet = 42:3b3c:d92f:96f2:7a9f:dff8:7b2e:3f86 +-----BEGIN RSA PUBLIC KEY----- +MIIBCgKCAQEAwR+ltgpQHd7Zo44JAcaLZZ0T6/9VBvwFAnG446vTzRL1cX331akV +Ceh6IkwBkM5lWNmNVYu/oeqd6cj/i6AgDMZRETbDLBSX338wPVXqxaPsIMgyAD63 +WRsken+VZKG8qrkBlBIgoXD/THQWUpw41B0tKNYnv8HQTcB2hlLZ5i4r8A38UADL +8vQd0V1CAfqa3Q80pDxmTtGo41b/mfHUMF4iRR94T65AzpHmofcMaJ9ThiQ3bDiW +D4rj2mjvOWcnLsm9eNXTtwIG1S6Go5Nnf1qXUGTsskm4J193zhxS+PL1KEamuE29 +8NLec8P0aYD2rlyMx4rale1j8jpvS0El/wIDAQAB +-----END RSA PUBLIC KEY----- diff --git a/retiolum/hosts/ohz b/retiolum/hosts/ohz new file mode 100644 index 00000000..e452743b --- /dev/null +++ b/retiolum/hosts/ohz @@ -0,0 +1,10 @@ +Subnet = 10.243.118.171/32 +Subnet = 42:a06d:7412:809a:b74a:8052:daba:c99f/128 +-----BEGIN RSA PUBLIC KEY----- +MIIBCgKCAQEA7vZFyHtBC9WbXTKcJ2mXxTsZnZqGrDzP7PVtkaBQfTT6J2Qtct5i +0klA8yvXHUeVdt+hho7rISX4LJr+RDVdhU4ZgrcyJ3rR3moRGzLUV2VLroc1Mnbs +kkK1mowNk/jZpf6XyRpGL+NFMCZexmfjTdMaMLhzoRbA6w/ffPSSuDZdbG2F5bMk +BmF6biPcS9Z652ePXh9ViUUKBpLTHQvgK5/iZjI6ik/eit50jrjO6MapUVP/7qob +VeXE7Zos3UuHLiKegN68VbFQp4qu7jNH4jRun3Pm/Zd/OaGCREIDnfyIyauDNkaT +QUEL+h0zsM+t2rLT08Wo/sdNX16iMrs9FwIDAQAB +-----END RSA PUBLIC KEY----- diff --git a/retiolum/hosts/pigstarter b/retiolum/hosts/pigstarter index 6904f4e0..b1c08801 100644 --- a/retiolum/hosts/pigstarter +++ b/retiolum/hosts/pigstarter @@ -1,4 +1,4 @@ -Address = 5.45.180.187 +Address = 192.40.56.122 #Address = pigstarter.de Subnet = 10.243.0.153 Subnet = 42:9143:b4c0:f981:6030:7aa2:8bc5:4110/128 diff --git a/retiolum/hosts/shabruecke_a0e95c28 b/retiolum/hosts/shabruecke_a0e95c28 new file mode 100644 index 00000000..7b9cbfa0 --- /dev/null +++ b/retiolum/hosts/shabruecke_a0e95c28 @@ -0,0 +1,12 @@ +Subnet = 10.243.206.121 +Subnet = 42:4687:e87e:41af:e84b:c52f:ccfb:d2f7 + +-----BEGIN RSA PUBLIC KEY----- +MIIBCgKCAQEAzN5IRY/9kN8ix5yW2uv1Ltj5rKx1deloB4C/nBsPToA9E/ojASkR +7V2NDpJGj9QTP4/8ivi0lI+BNOrlHMKxaVvxy/LBmqDQ8ccMQX/4MNGhv1d09iu/ +SBuko/f6lYHm4y71fQlgVuDPS8RDRY/2+008L6rq72RTxuvHZm7smyxDNoUTKWFK +iJfCxV6nLPiUt3ioEzTMDKAZ7xbOofsTbAxe5Uh4jc9wr3XYkN3y6KHMWDyjWYAo +WHN0sdEkWONrJvS2b4L3Vl7Mw80Sg1HjmOEJmygY63bDgfP1UnH/ezJxX79RLeZi +VNF1fD0rJPN937fkYchOT4HJP+RvydB5DwIDAQAB +-----END RSA PUBLIC KEY----- + diff --git a/retiolum/scripts/adv_graphgen/find-all-nodes.py b/retiolum/scripts/adv_graphgen/find-all-nodes.py new file mode 100644 index 00000000..ae0fae8f --- /dev/null +++ b/retiolum/scripts/adv_graphgen/find-all-nodes.py @@ -0,0 +1,59 @@ +#!/usr/bin/python + +def find_potential_super(path="/etc/tinc/retiolum/hosts"): + import os + import re + + needle_addr = re.compile("Address\s*=\s*(.*)") + needle_port = re.compile("Port\s*=\s*(.*)") + for f in os.listdir(path): + with open(path+"/"+f) as of: + addrs = [] + port = "655" + + for line in of.readlines(): + + addr_found = needle_addr.match(line) + if addr_found: + addrs.append(addr_found.group(1)) + + port_found = needle_port.match(line) + if port_found: + port = port_found.group(1) + + if addrs : yield (f ,[(addr ,int(port)) for addr in addrs]) + +def try_connect(addr): + try: + from socket import socket,AF_INET,SOCK_STREAM + s = socket(AF_INET,SOCK_STREAM) + s.settimeout(2) + s.connect(addr) + s.settimeout(None) + s.close() + return addr + except Exception as e: + pass + #return () + +def check_one_super(ha): + host,addrs = ha + valid_addrs = [] + for addr in addrs: + ret = try_connect(addr) + if ret: valid_addrs.append(ret) + if valid_addrs: return (host,valid_addrs) + +def check_all_the_super(path="/etc/tinc/retiolum/hosts"): + from multiprocessing import Pool + p = Pool(20) + return filter(None,p.map(check_one_super,find_potential_super(path))) + + + +if __name__ == "__main__": + """ + usage + """ + for host,addrs in check_all_the_super(): + print host,addrs diff --git a/util/bin/graphitec b/util/bin/graphitec new file mode 100755 index 00000000..52aa9834 --- /dev/null +++ b/util/bin/graphitec @@ -0,0 +1,5 @@ +#!/bin/sh +H=${GRAPHITE_HOST:-localhost} +P=${GRAPHITE_PORT:-2003} +curr=$(date '+%s') +printf "%s %s %s\n" $1 $2 $curr | nc -q0 $H $P |