This commit is contained in:
Sean Corrigan 2021-09-09 18:07:48 -04:00
parent 2dba504253
commit fc3d3bcc6e

24
main.py Normal file
View File

@ -0,0 +1,24 @@
## Requires NUT2 from PIP
from nut2 import PyNUTClient
import os
# hostList = os.environ["hosts"]
# hostList = hostList.split(",")
# dev
hostList = ['10.0.5.2', '10.0.5.181']
test = []
## pull all the UPSes froom each host
for host in hostList:
client = PyNUTClient(host, '3493')
for UPS in client.list_ups():
test.append(str(UPS))
print(test)
# client = PyNUTClient('10.0.5.2', '3493')
# print(client.list_ups())
# print(client.list_vars("Net-UPS1"))