From fc3d3bcc6e66159b629ea2b649d153d99da7e616 Mon Sep 17 00:00:00 2001 From: Sean Corrigan Date: Thu, 9 Sep 2021 18:07:48 -0400 Subject: [PATCH] Commit --- main.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 main.py diff --git a/main.py b/main.py new file mode 100644 index 0000000..8f9ec74 --- /dev/null +++ b/main.py @@ -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")) \ No newline at end of file