Kiss Gabor (Bitman)
2010-Jun-07 13:41 UTC
[Nut-upsdev] Patch: upssched puts UPS name in the command line
Dear folks, The patch in attachment allows upssched to put actual UPS name into command line even if configuration contains wildcard (*). E.g. AT LOWBATT * EXECUTE "LOWBATT %s" AT ONLINE ups3 EXECUTE "ONLINE %s" where %s is replaced with UPS name before logging and execution. A possible further enhancement could be if regular expressions are also acceptable in place of asterisk. I mean something like this: AT FSD ups1 EXECUTE "shutting down %s" AT FSD * EXECUTE "shutting down %s" AT FSD /^ups[2-4]$/ EXECUTE "blowing up %s :-)" However I know tee few automake, GNU config and various regexp implementations. I'm afraid I could not add this feature in a platform independent way. Regards Gabor
Kiss Gabor (Bitman)
2010-Jun-07 13:58 UTC
[Nut-upsdev] Patch: upssched puts UPS name in the command line
> The patch in attachment allows upssched to put actual UPS nameEeeer... the patch I missed to attach... Gabor -------------- next part -------------- A non-text attachment was scrubbed... Name: upssched.c.patch Type: text/x-diff Size: 536 bytes Desc: URL: <http://lists.alioth.debian.org/pipermail/nut-upsdev/attachments/20100607/e6298dc6/attachment.patch>
Charles Lepple
2010-Jun-08 00:41 UTC
[Nut-upsdev] Patch: upssched puts UPS name in the command line
On Mon, Jun 7, 2010 at 9:58 AM, Kiss Gabor (Bitman) <kissg at ssg.ki.iif.hu> wrote:> The patch in attachment allows upssched to put actual UPS nameThe UPSNAME environment variable should be inherited by upssched from upsmon, no? -- - Charles Lepple
Kiss Gabor (Bitman)
2010-Jun-22 14:58 UTC
[Nut-upsdev] Patch: upssched puts UPS name in the command line
Dear Arjen,> If using regular expressions is important for you, write a (trivial) script > that generates the upssched.conf file for you. It might for instance take theYes, this is also a possible solution. However does not give the same result.> upsmon.conf file as input, parse the MONITOR lines and build an appropriate > upssched.conf file from there. This would be much more light weight than doing > this at runtime. > > Adding regular expressions in upssched is a huge waste of effort. We have > better things to work on too.Do you mean I do not belong to "us"? :) Best regards Gabor -- E-mail = m-mail * c-mail ^ 2