Looping over all monitors to get their status I tend to run into the below issue.
Is it possible there is a type issue in your code?
my code is roughly
monitors = api.get_monitors()
n_monitors = len(monitors)
cnt_up = 0
cnt_active = 0
for monitor in monitors:
id = monitor["id"]
name = monitor["name"]
if monitor["active"]:
#print(id)
#print(name)
cnt_active += 1
st = 9981 #default value
for n in range(1):
st = api.get_monitor_status(id)
if st == 1:
cnt_up += 1