Changeset 10434 in genesis
- Timestamp:
- Apr 12, 2012, 7:34:31 AM (13 years ago)
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
nodes/proxy10/wleiden.yaml
r10374 r10434 2 2 # vim:ts=2:et:sw=2:ai 3 3 # 4 board : "net45xx" 4 5 comment : "None" 5 6 externalif: "sis1" -
nodes/proxy11/wleiden.yaml
r10374 r10434 2 2 # vim:ts=2:et:sw=2:ai 3 3 # 4 board : "net45xx" 4 5 comment : "None" 5 6 externalif: "sis1" -
nodes/proxy12/wleiden.yaml
r10374 r10434 2 2 # vim:ts=2:et:sw=2:ai 3 3 # 4 board : "net45xx" 4 5 comment : "None" 5 6 externalif: "sis0" -
nodes/proxy14/wleiden.yaml
r10416 r10434 2 2 # vim:ts=2:et:sw=2:ai 3 3 # 4 board : "net45xx" 4 5 comment : "None" 5 6 externalif: "sis0" -
nodes/proxy16/wleiden.yaml
r10374 r10434 2 2 # vim:ts=2:et:sw=2:ai 3 3 # 4 board : "net45xx" 4 5 comment : "None" 5 6 externalif: "sis0" -
nodes/proxy17/wleiden.yaml
r10400 r10434 2 2 # vim:ts=2:et:sw=2:ai 3 3 # 4 board : "ALIX2" 4 5 comment : "None" 5 6 externalif: "vr0" -
nodes/proxy18/wleiden.yaml
r10374 r10434 2 2 # vim:ts=2:et:sw=2:ai 3 3 # 4 board : "net45xx" 4 5 comment : "None" 5 6 externalif: "sis0" -
nodes/proxy2/wleiden.yaml
r10374 r10434 2 2 # vim:ts=2:et:sw=2:ai 3 3 # 4 board : "net45xx" 4 5 comment : "None" 5 6 externalif: "sis0" -
nodes/proxy20/wleiden.yaml
r10399 r10434 2 2 # vim:ts=2:et:sw=2:ai 3 3 # 4 board : "net45xx" 4 5 comment : "None" 5 6 externalif: "sis0" -
nodes/proxy3/wleiden.yaml
r10374 r10434 2 2 # vim:ts=2:et:sw=2:ai 3 3 # 4 board : "net45xx" 4 5 comment : "None" 5 6 externalif: "sis0" -
nodes/proxy4/wleiden.yaml
r10374 r10434 2 2 # vim:ts=2:et:sw=2:ai 3 3 # 4 board : "net45xx" 4 5 comment : "None" 5 6 externalif: "sis0" -
nodes/proxy5/wleiden.yaml
r10374 r10434 2 2 # vim:ts=2:et:sw=2:ai 3 3 # 4 board : "net45xx" 4 5 comment : " verbonden met glasvezel gateway 192.168.0.1 nameservers: 217.149.192.6 en 217.149.196.6 " 5 6 externalif: "sis0" -
nodes/proxy6/wleiden.yaml
r10396 r10434 2 2 # vim:ts=2:et:sw=2:ai 3 3 # 4 board : "net45xx" 4 5 comment : "None" 5 6 externalif: "sis0" -
nodes/proxy7/wleiden.yaml
r10374 r10434 2 2 # vim:ts=2:et:sw=2:ai 3 3 # 4 board : "ALIX2" 4 5 comment : " verbonden met 'vuil' internet van Zorggroep Rijnland lokaal ip en nameservers via dhcp LET OP: niet standaard configuratie ivm lokale ap's!" 5 6 externalif: "vr0" -
nodes/proxy9/wleiden.yaml
r10374 r10434 2 2 # vim:ts=2:et:sw=2:ai 3 3 # 4 board : "net45xx" 4 5 comment : "None" 5 6 externalif: "sis0" -
nodes/proxy97/wleiden.yaml
r10374 r10434 2 2 # vim:ts=2:et:sw=2:ai 3 3 # 4 board : "net45xx" 4 5 comment : "None" 5 6 externalif: "sis0" -
tools/check-batch-cmd
r10433 r10434 51 51 pass 52 52 53 class ConnectError(Exception): 54 pass 55 53 56 54 57 55 58 def host_ssh_cmd(hostname, cmd): 56 ssh = paramiko.SSHClient() 57 ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) 58 ssh.connect(hostname, username='root', password=SSHPASS,timeout=3) 59 stdin, stdout, stderr = ssh.exec_command(cmd) 60 stdout = stdout.readlines() 61 stderr = stderr.readlines() 62 ssh.close() 63 if stderr: 64 raise CmdError((stderr, stdout)) 65 return stdout 59 try: 60 ssh = paramiko.SSHClient() 61 ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) 62 ssh.connect(hostname, username='root', password=SSHPASS,timeout=3) 63 stdin, stdout, stderr = ssh.exec_command(cmd) 64 stdout = stdout.readlines() 65 stderr = stderr.readlines() 66 ssh.close() 67 if stderr: 68 raise CmdError((stderr, stdout)) 69 return stdout 70 except socket.error, e: 71 raise ConnectError(e) 66 72 67 73 def parse_ini(lines): … … 168 174 parser = argparse.ArgumentParser(prog='Various WL management tools') 169 175 parser.add_argument('--ask-pass', dest="ask_pass", action='store_true', help='Ask password if SSHPASS is not found') 176 parser.add_argument('--filter', dest="use_filter", action='store_true', help='Thread the host definition as an filter') 170 177 subparsers = parser.add_subparsers(help='sub-command help') 171 178 … … 189 196 SSHPASS = getpass.getpass("WL root password: ") 190 197 191 # XXX: We need this loop when using filters 192 #for host in gformat.get_hostlist(): 193 # if filters and not any([f.lower() in host.lower() for f in filters]): 194 # continue 195 196 197 if args.func == 'bridge': 198 if args.action == 'keys': 199 ubnt_keys(args.host) 200 elif args.action == 'snmp': 201 ubnt_snmp(args.host) 202 elif args.action == 'probe': 203 ubnt_probe(args.host) 204 elif args.func == 'node': 205 if args.action == 'check': 206 node_check(args.host) 198 199 if args.use_filter: 200 hosts = [] 201 for host in gformat.get_hostlist(): 202 if args.host in host: 203 hosts.append(host) 204 else: 205 hosts = [args.host] 206 207 208 for host in hosts: 209 try: 210 if args.func == 'bridge': 211 if args.action == 'keys': 212 ubnt_keys(host) 213 elif args.action == 'snmp': 214 ubnt_snmp(host) 215 elif args.action == 'probe': 216 ubnt_probe(host) 217 elif args.func == 'node': 218 if args.action == 'check': 219 node_check(host) 220 except ConnectError: 221 print "#ERR: Connection failed to host %s" % host
Note:
See TracChangeset
for help on using the changeset viewer.