replace host -> name

This commit is contained in:
sergey 2025-04-22 18:35:11 +03:00
parent 876b3901a5
commit 9ac5c80f73
1 changed files with 2 additions and 2 deletions

View File

@ -28,7 +28,7 @@ def get_active_problems() -> dict:
event_ids.append(problem["eventid"])
events = api.event.get(
selectHosts=["host"],
selectHosts=["name"],
eventids=event_ids,
output=[
"eventid",
@ -38,7 +38,7 @@ def get_active_problems() -> dict:
)
events_dict = {"event_ids": []}
for event in events:
event["host"] = event.pop("hosts", None)[0]["host"]
event["host"] = event.pop("hosts", None)[0]["name"]
events_dict[event["eventid"]] = event
events_dict["event_ids"].append(event["eventid"])
return events_dict