dev #2
@@ -106,10 +106,10 @@ def index():
|
|||||||
for line in f:
|
for line in f:
|
||||||
line = line.strip()
|
line = line.strip()
|
||||||
for dev in devices:
|
for dev in devices:
|
||||||
# exakte Prüfung, Name gefolgt von 'ist erreichbar!' oder 'ist nicht erreichbar!'
|
# prüfen, ob Name enthalten ist und Statusphrase
|
||||||
if line.startswith(f"{dev[1]} ist erreichbar!"):
|
if f"{dev[1]} ist erreichbar!" in line:
|
||||||
status_dict[dev[0]] = "online"
|
status_dict[dev[0]] = "online"
|
||||||
elif line.startswith(f"{dev[1]} ist nicht erreichbar!"):
|
elif f"{dev[1]} ist nicht erreichbar!" in line:
|
||||||
status_dict[dev[0]] = "offline"
|
status_dict[dev[0]] = "offline"
|
||||||
|
|
||||||
# Template rendern mit Devices, Status und Intervall
|
# Template rendern mit Devices, Status und Intervall
|
||||||
|
|||||||
Reference in New Issue
Block a user