📜 ⬆️ ⬇️

Monitor UPS workstations in Windows with Network UPS Tools

When does the task arise to monitor workstations without failures? Squeaked - replaced, the end. Repairing UPSs is a thankless task, changing batteries — not everyone wants to mess around (or even moveton).

So I thought, especially after the UPS series with the failed electronics. The situation was aggravated by software from manufacturers. He, as if to put it more softly, junk. And at all - APC, Ippon, Powercom, TrippLite. What server that for workstations. Trying the paid versions after the experience with free ones - no desire has arisen. But quite fun when UPS from different manufacturers.

But still need to monitor. The advantages are obvious: 1) you can change the UPS before it gives a farewell squeak; 2) you can immediately see where the battery died, and where the electronics.
The minus is as simple as ever: the cost of the solution, in money or man-hours.
')
This problem will be solved.

If we have a zoo, then the most adequate way is Network UPS Tools .

According to him there is little information about Windows, but there is still no GUI. But we will solve it .

In fairness it should be noted that there is a similar project in Python . But for me personally, it seems completely unnecessary to use Python (and similar technical solutions) where you can get along with a couple of lines of native scripting.

Disclaimer
  • This is not a “turnkey solution”.
  • This is not a sentence, but a story.
  • Yes, there is Zabbix, Cacti, etc, and these are heavyweight solutions for large companies that require a dedicated server and still some kind of intermediate layer to support the appropriate UPS protocol.
  • With all of the above, the solution is quite simple, easy enough and costs 0 currency.


Of course, to collect information, you will need UPS with the info-port. I have problems with IPPON COM-port, everything else works with a bang.

Usually for workstations using the connection of the UPS via USB, this case and consider. It is necessary to install NUT on all workstations with UPS.
Possible problems with this:


An example script of semi-automatic installation of NUT on clients:

N:\NUT-Installer-2.6.5-6.msi /qn copy N:\dll\ssleay32.dll C:\Windows\System32 /Y copy N:\dll\libeay32.dll C:\Windows\System32 /Y copy N:\dll\libgcc_s_dw2-1.dll C:\Windows\System32 /Y copy N:\dll\libusb.dll C:\Windows\System32 /Y copy N:\etc\* "%programfiles%\NUT\etc" rem  IP-    NUT  SET IP=192.168.100.10 set ip_address_string="IP Address" rem Uncomment the following line when using Windows 7 (with removing "rem")! set ip_address_string="IPv4-" REM echo Network Connection Test for /f "usebackq tokens=2 delims=:" %%f in (`ipconfig ^| findstr /c:%ip_address_string%`) do SET IP=%%f ECHO LISTEN %IP% 3493 >> "%programfiles%\NUT\etc\upsd.conf" rem   libusb  N:\libusb-win32-bin-1.2.6.0\bin\inf-wizard.exe rem  ,     notepad "%programfiles%\NUT\etc\ups.conf" notepad "%programfiles%\NUT\etc\upsmon.conf" pause net use N: /delete /Y 

How to understand why NUT does not work under Windows:


For the monitoring server are needed:


Base SQL and www put in the appropriate directories of the web north. Scripts from batch_scripts are copied to the NUT installation folder. We start the web server, go to localhost / index_ups.php . Add any of the client UPS in the format UPS_name @ host. Run the get_ups_list_mysql.cmd script. We are checking. Enjoy

image

What can we see useful, besides the current state? For example:


A few points:


If someone has problems with the installation / operation of NUT under Windows - write, let's figure it out together.

Thanks for attention!

Source: https://habr.com/ru/post/421039/


All Articles