Patched offline ups error

This commit is contained in:
Sean Corrigan 2021-11-05 12:20:39 -04:00
parent 94dace6dda
commit e888835662

11
main.py
View File

@ -43,10 +43,13 @@ def main():
## pull all the UPSes froom each host into a nice dict ## pull all the UPSes froom each host into a nice dict
for host in hostList: for host in hostList:
upslist[host] = [] try:
client = PyNUTClient(host, '3493') upslist[host] = []
for UPS in client.list_ups(): client = PyNUTClient(host, '3493')
upslist[host].append(UPS) for UPS in client.list_ups():
upslist[host].append(UPS)
except:
print('UPS {} is having issues'.format(host))
# print(upslist) # print(upslist)