prometheus-mumble/src/status.py

20 lines
633 B
Python
Raw Normal View History

2024-01-24 09:13:20 +01:00
import sys, Ice
import Murmur
with Ice.initialize(sys.argv) as communicator:
base = communicator.stringToProxy("Meta:tcp -h 127.0.0.1 -p 6502")
meta = Murmur.MetaPrx.checkedCast(base)
if not meta:
raise RuntimeError("Invalid proxy")
servers = meta.getAllServers()
if len(servers) == 0:
print("No servers found")
for currentServer in servers:
if currentServer.isRunning():
print("Found server (id=%d):\tOnline since %d seconds" % (currentServer.id(), currentServer.getUptime()))
else:
print("Found server (id=%d):\tOffline" % currentServer.id())