nut icon indicating copy to clipboard operation
nut copied to clipboard

A tool for testing NUT protocol compliance

Open desertwitch opened this issue 3 months ago • 3 comments

Ubiquiti recently released their own line of UPS: https://eu.store.ui.com/eu/en/category/integrations-power-tech/collections/unifi-power-tech-ups/products/ups-tower-eu

These UPS are self-contained servers (running proprietary "server" firm-/software). They have an ethernet port, so they can be integrated into their proprietary UI ecosystem.

Now this is all not really relevant for NUT or unusual, but they also have an in-built NUT server. However, seems to be not an actual NUT server but their own implementation of the NUT protocol. The purpose seems to be so that NUT clients are able to monitor these UPS "servers" over IP, but there's a catch.

Their NUT implementation is currently non-compliant, a lot of users are reporting issues connecting from "real" NUT: https://community.ui.com/questions/Unifi-UPS-Tower-wont-allow-NUT-clients-to-connect/19460ca6-d057-4de0-beb4-c68438b1b281 https://community.ui.com/questions/UniFi-UPS-sends-incorrect-responses-in-NUT-protocol/7f862573-eda4-4180-a987-0aca1233ee8a#answer/a857cb90-866a-4db0-9f8a-9e1dab1af14a

Now this is all for the most part their problem and on them to fix, but it sparked an idea for the NUT project.

Is there a tool to help manufacturers or even packagers, other supporters to quickly check a target for NUT protocol compliance? Imagine quickly running nut_proto 192.168.0.5 (for lack of a better tool name) and it'd test if the target server fully speaks NUT...? It'd also help developers implement NUT protocols on their side which are actually compliant (if they can't bother to RTFM...) 😉

desertwitch avatar Oct 31 '25 13:10 desertwitch

I realize this probably sounds easier than it really is, but maybe it could be an idea for easily accessible protocol commands? I'm surprised they even went this route over SNMP with a standardized MIB, but it's still pretty cool that they chose NUT (even if a bit broken on their side at the moment)...

desertwitch avatar Oct 31 '25 14:10 desertwitch

In a way, there's the NIT suite that does part of that (running some tests from local sources against freshly built server using breshly built clients). Part of that are runs of the upsc, python and C++ clients (upslog and upsmon can be enabled). Maybe they can also be used for a compliance test. Probably PyNUTClient should be revised (extended?) to cover all of the protocol; and its test to call it in different ways.

jimklimov avatar Oct 31 '25 18:10 jimklimov

And I guess it would benefit from a strict subset to check for compliance with our published RFC (in case we have extensions over it by now, not sure).

jimklimov avatar Oct 31 '25 18:10 jimklimov