[Nut-upsdev] A patch to add a command to get client information

Arnaud Quette aquette.dev at gmail.com
Wed Feb 29 13:16:29 UTC 2012


Hi René,

2012/2/9 Arnaud Quette <aquette.dev at gmail.com>:
> 2012/2/8 René Martín Rodríguez <rmrodri at ull.edu.es>:
>> El 08/02/12 09:14, Arnaud Quette escribió:
>>
>>> Hi Charles,
>>>
>>> please to see you jumping in ;-)
>>>
>>> 2012/2/8 Charles Lepple<clepple at gmail.com>:
>>>>>
>>>>> Do you know which SVN revision or NUT release your patch was originally
>>>>> based on? Possibly v2.4.3?
>>>>
>>>> Never mind, it was easy to merge by hand. A temporary branch is on
>>>> GitHub:
>>>>
>>>> https://github.com/clepple/nut/commits/git-list_clients/
>>>>
>>>> Arnaud: what do you think about the syslog-based client list, which is
>>>> included? I saw your comments proposing the protocol-based approach, but do
>>>> we need both? I guess it can't hurt, since someone would have to become the
>>>> 'nut' user to signal upsd.
>>>
>>> I don't think we need both, and I don't see any added value in having
>>> the syslog complement.
>>> René probably got me wrong, or simply merged his original code / idea with
>>> mine.
>>>
>>> that being said, it's nice from René to have done the work (thanks for
>>> that René, much appreciated).
>>> as he told, upsc implementation is still missing, to get the complete
>>> picture.
>>>
>>> cheers,
>>> Arnaud
>>
>> I agree with you, there is no need to have both methods. I sent all my
>> modifications to you, hoping you choose one of them to merge in the repo.
>>
>> We need to change our checker scripts depending on the method you choose,
>> once it's done I prefer the second implementation.
>
> the way to go is really through the protocol, not syslog.
> though, ATM, upsc side is still missing, and the whole commit hasn't
> reached the trunk.
> but you can base on the provided spec.
> if you have any urgent need, just tell back and I'll check to
> prioritize this upsc completion.
>
>> I'm very sorry about the incident with the dictionary, I hope any system
>> will be seriously affected by the introduction of that tremendous bug in the
>> code.
>
> this has probably already caused a global blackout ;-)

I've just completed implementation of this feature.
It will soon land into the Subversion trunk, but is currently only
available on my github:
https://github.com/aquette/nut/tree/git-list_clients

Note that the final implementation is (note the "S" removal from
"CLIENT*S", due to coherence and client side checking):

- server side (network protocol)
Form:

	LIST CLIENT <device_name>
	LIST CLIENT ups1

Response:

	BEGIN LIST CLIENT <device_name>
	CLIENT <device name> <client IP address>
	...
	END LIST CLIENT <device_name>

	BEGIN LIST CLIENT ups1
	CLIENT ups1 ::1
	CLIENT ups1 192.168.1.2
	END LIST CLIENT ups1

- client side:
    $ upsc -c <device name>

So you may want to adjust your local implementation to be forward compatible...

cheers,
Arnaud
-- 
Linux / Unix Expert R&D - Eaton - http://powerquality.eaton.com
Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/
Debian Developer - http://www.debian.org
Free Software Developer - http://arnaud.quette.free.fr/



More information about the Nut-upsdev mailing list