20 lines
631 B
Python
20 lines
631 B
Python
import subprocess
|
|
import json
|
|
|
|
devices = [
|
|
("Dell PowerEdge Node 4 iDRAC", "140.44.44.124"),
|
|
("UniFi Aggregation Switch", "14.44.4.26"),
|
|
("UniFi Closet Switch", "14.44.4.61"),
|
|
("UniFi Compute Switch", "14.44.4.107"),
|
|
("UniFi Attic Switch", "14.44.4.98"),
|
|
("UniFi Garage Switch", "14.44.4.96"),
|
|
("Tempest Weather Station", "14.4.4.47"),
|
|
("Sense Energy Gateway", "14.4.4.48"),
|
|
]
|
|
|
|
for name, ip in devices:
|
|
res = subprocess.run(["ping", "-n", "1", "-w", "1000", ip], capture_output=True, text=True)
|
|
status = "ONLINE" if res.returncode == 0 else "OFFLINE"
|
|
print(f"[{status}] {name} ({ip})")
|
|
|