import os, sys, socket def q(h): try: return socket.gethostbyname(h) except Exception as e: return "FAIL:%s" % e try: for h in ["db.373center.esimo.ru", "idp.373center.esimo.ru", "is.373center.esimo.ru", "373center.esimo.ru", "zabbix.373center.esimo.ru", "db.esimo.ru", "db.meteo.ru"]: print("%s=%s" % (h, q(h))) for ip in [("195.178.197.87", 1521), ("db.373center.esimo.ru", 5432)]: try: s = socket.create_connection(ip, timeout=6) print("CONN %s:%s OK" % ip) s.close() except Exception as e: print("CONN %s:%s FAIL %s" % (ip[0], ip[1], e)) except Exception as e: print("ERR %s" % e) sys.stdout.flush() os._exit(0)