[Nut-upsdev] feature request -- talk to the router, not the UPS

Ted Mittelstaedt tedm at mittelstaedt.us
Wed Jun 4 01:10:17 UTC 2014


On 6/2/2014 6:28 AM, Charles Lepple wrote:
> 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):
>
> http://news.gmane.org/find-root.php?message_id=20130703045347.55D4172182%40mail.gishpuppy.com
>

That one does not monitor for low battery.

> 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.)
>

Say what?  A lot of those setups connect DSR to the relay contact and 
when that line isn't raised high the serial port under UNIX is closed - 
why does the generic UPS driver still attempt to poll it?????  Sloppy
coding?

The hardware design is so that the driver can go to open the com port 
then just block until DSR is asserted.  Then you can start the polling, 
looking for the CD line to go high (indicating a low battery)

> 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.
>

the hack posted (inserting a relay in a spare mouse, really!?!?) that 
you linked to is really unbelievable.

Ted



More information about the Nut-upsdev mailing list