[Nut-upsdev] feature request -- talk to the router, not the UPS
clepple at gmail.com
Mon Jun 2 13:28:37 UTC 2014
On Jun 2, 2014, at 7:27 AM, elliot smith wrote:
> For example I am using FreeNAS. Rather than supporting my unorthodox UPS
> signaling scheme by installing it as a script in FreeNAS, (and me probably
> messing something up in the process) this scheme could be supported
> instead by NUT.
Bear in mind that all of the NUT drivers have authors who are expected to be maintainers of that driver. Are you volunteering?
> For the port, when I'm configuring my "UPS" settings in
> the FreeNAS GUI, instead of specifying one of the USB ports, I would
> specify the TCI/IP port, with the IP of the device to ping.
Are you referring to an ICMP ping here? Some OSes require root privileges to open a raw socket to send the ping echo-request, and NUT is designed to drop root privileges when a driver starts.
Alternatively, you could call out to the system's ping binary. I haven't checked, but I suspect this would require a bunch of options to handle various command line options and return codes.
You could also have an option for a TCP or UDP "ping" to some service on whatever device you are trying to contact, but I think this explosion of options points to some sort of scripting solution coupled with an existing driver.
Note that we are happy to include these sorts of scripts in NUT.
> On Mon, June 2, 2014 2:50 am, Ted Mittelstaedt wrote:
>> That kind of scheme should be handled by scripting - not by NUT.
>> As far as having a _perfectly good UPS with no driver_, ANY UPS can
>> be converted into a "dumb" UPS with the addition of 2 relays.
There was also this discussion last summer (similar to Ted's printer idea, but lower power):
I'm not a huge fan of polling when edge-triggered events are available. (That said, dummy-ups polls its state file once a second, and that could be improved upon with something like inotify.)
In most cases, you can add a devd (FreeBSD) or udev (Linux) rule that triggers when a device disappears, without affecting normal operation of that device while it is connected. Both devd and udev will simply run all of the matching rules when the specified action occurs.
clepple at gmail
More information about the Nut-upsdev