Hi all, I've not been able to find the answer to my timer problem in the faq or the archives. (or google) Basically, I can't get timers to fire. They fire ignoring the timer value, as if the timer was set to 0. I'm using the OpenFiler distribution, patched to the latest and greatest. upsmon 2.2.2 When I pull the power plug, I see the text "Im In Battery" instantly, instead of after 20s. Power returned after 55 seconds. Could I be missing some dependency, external application, which upsmon uses as a timer? (A side issue is that it's not using the correct variable when passing to upssched-cmd, but uses the notify text itself, "ONBATT", this can be seen in the last line from, messages, $1 is "UPS ups0 at localhost on line power", but this is not important for me, but may be used to explain why the timer is not working) ONBATT Dec 2 18:48:56 storage01 upsmon[3603]: ONBATT Dec 2 18:48:56 storage01 wall[4371]: wall: user root broadcasted 1 lines (8 chars) Dec 2 18:48:56 storage01 upssched-cmd: Im On Battery Broadcast message from nut (Wed Dec 2 18:49:51 2009): UPS ups0 at localhost on line power Dec 2 18:49:51 storage01 upsmon[3603]: UPS ups0 at localhost on line power Dec 2 18:49:51 storage01 wall[4377]: wall: user root broadcasted 1 lines (34 chars) Dec 2 18:49:51 storage01 upssched-cmd: Unrecognized command: UPS ups0 at localhost on line power Last two lines of upssched.conf AT ONBATT * START-TIMER ONBATT 20 AT ONLINE * CANCEL-TIMER ONBATT Contents of upssched-cmd case $1 in upsgone) logger -t upssched-cmd "The UPS has been gone for awhile" ;; ONBATT) logger -t upssched-cmd "Im On Battery" ;; *) logger -t upssched-cmd "Unrecognized command: $1" ;; esac Regards, John Jore -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20091202/17806419/attachment.htm>
What is your pollfreq set to? On Wed, 2 Dec 2009, John Jore wrote:> Hi all, I've not been able to find the answer to my timer problem in the faq or the archives. (or google) > > Basically, I can't get timers to fire. They fire ignoring the timer value, as if the timer was set to 0. I'm using the OpenFiler distribution, patched to the latest and greatest. upsmon 2.2.2 > > When I pull the power plug, I see the text "Im In Battery" instantly, instead of after 20s. Power returned after 55 seconds. Could I be missing some dependency, external application, which upsmon uses as a timer? > (A side issue is that it's not using the correct variable when passing to upssched-cmd, but uses the notify text itself, "ONBATT", this can be seen in the last line from, messages, $1 is "UPS ups0 at localhost on line power", but this is not important for me, but may be used to explain why the timer is not working) > > > ONBATT > Dec 2 18:48:56 storage01 upsmon[3603]: ONBATT > Dec 2 18:48:56 storage01 wall[4371]: wall: user root broadcasted 1 lines (8 chars) > Dec 2 18:48:56 storage01 upssched-cmd: Im On Battery > > Broadcast message from nut (Wed Dec 2 18:49:51 2009): > > UPS ups0 at localhost on line power > Dec 2 18:49:51 storage01 upsmon[3603]: UPS ups0 at localhost on line power > Dec 2 18:49:51 storage01 wall[4377]: wall: user root broadcasted 1 lines (34 chars) > Dec 2 18:49:51 storage01 upssched-cmd: Unrecognized command: UPS ups0 at localhost on line power > > > Last two lines of upssched.conf > AT ONBATT * START-TIMER ONBATT 20 > AT ONLINE * CANCEL-TIMER ONBATT > > > Contents of upssched-cmd > case $1 in > upsgone) > logger -t upssched-cmd "The UPS has been gone for awhile" > ;; > ONBATT) > logger -t upssched-cmd "Im On Battery" > ;; > *) > logger -t upssched-cmd "Unrecognized command: $1" > ;; > esac > > > > Regards, > John Jore >
Just realized I did a reply, not "reply to all". Still looking for a fix for this. Does anyone know if the scheduler uses any external applications/modules? Or why it would fire after 0 seconds instead of the given value? Regards, John Jore -----Original Message----- From: John Jore Sent: 2. desember 2009 22:45 To: 'Justin Piszcz' Subject: RE: [Nut-upsuser] Timers fireing too early Hi and no, These were the defaults in the configuration file. But the contents of upssched is executed, it just happens after (POLLFREQ + 0) seconds instead of (POLLFREQ + 30) seconds. JJ -----Original Message----- From: Justin Piszcz [mailto:jpiszcz at lucidpixels.com] Sent: 2. desember 2009 22:24 To: John Jore Subject: RE: [Nut-upsuser] Timers fireing too early The default is 30 (I believe), did you try raising it? [apc] driver = usbhid-ups port = auto desc = "APC 1500VA" pollfreq = 5 On Wed, 2 Dec 2009, John Jore wrote:> Hi Justin, > The values are: > > POLLFREQ 5 > POLLFREQALERT 5 > > JJ > > -----Original Message----- > From: Justin Piszcz [mailto:jpiszcz at lucidpixels.com] > Sent: 2. desember 2009 22:07 > To: John Jore > Cc: nut-upsuser at lists.alioth.debian.org > Subject: Re: [Nut-upsuser] Timers fireing too early > > What is your pollfreq set to? > > On Wed, 2 Dec 2009, John Jore wrote: > >> Hi all, I've not been able to find the answer to my timer problem in the faq or the archives. (or google) >> >> Basically, I can't get timers to fire. They fire ignoring the timer value, as if the timer was set to 0. I'm using the OpenFiler distribution, patched to the latest and greatest. upsmon 2.2.2 >> >> When I pull the power plug, I see the text "Im In Battery" instantly, instead of after 20s. Power returned after 55 seconds. Could I be missing some dependency, external application, which upsmon uses as a timer? >> (A side issue is that it's not using the correct variable when passing to upssched-cmd, but uses the notify text itself, "ONBATT", this can be seen in the last line from, messages, $1 is "UPS ups0 at localhost on line power", but this is not important for me, but may be used to explain why the timer is not working) >> >> >> ONBATT >> Dec 2 18:48:56 storage01 upsmon[3603]: ONBATT >> Dec 2 18:48:56 storage01 wall[4371]: wall: user root broadcasted 1 lines (8 chars) >> Dec 2 18:48:56 storage01 upssched-cmd: Im On Battery >> >> Broadcast message from nut (Wed Dec 2 18:49:51 2009): >> >> UPS ups0 at localhost on line power >> Dec 2 18:49:51 storage01 upsmon[3603]: UPS ups0 at localhost on line power >> Dec 2 18:49:51 storage01 wall[4377]: wall: user root broadcasted 1 lines (34 chars) >> Dec 2 18:49:51 storage01 upssched-cmd: Unrecognized command: UPS ups0 at localhost on line power >> >> >> Last two lines of upssched.conf >> AT ONBATT * START-TIMER ONBATT 20 >> AT ONLINE * CANCEL-TIMER ONBATT >> >> >> Contents of upssched-cmd >> case $1 in >> upsgone) >> logger -t upssched-cmd "The UPS has been gone for awhile" >> ;; >> ONBATT) >> logger -t upssched-cmd "Im On Battery" >> ;; >> *) >> logger -t upssched-cmd "Unrecognized command: $1" >> ;; >> esac >> >> >> >> Regards, >> John Jore >> >
On Dec 2, 2009, at 2:14 PM, John Jore wrote:> Basically, I can?t get timers to fire. They fire ignoring the timer > value, as if the timer was set to 0. I?m using the OpenFiler > distribution, patched to the latest and greatest. upsmon 2.2.2I'm not familiar with OpenFiler - is there a way to use the latest version of NUT (2.4.1) instead of 2.2.2? Is there anything else about OpenFiler that we should know?
On Dec 2, 2009, at 2:14 PM, John Jore wrote:> Hi all, I?ve not been able to find the answer to my timer problem in > the faq or the archives. (or google) > > Basically, I can?t get timers to fire. They fire ignoring the timer > value, as if the timer was set to 0. I?m using the OpenFiler > distribution, patched to the latest and greatest. upsmon 2.2.2 > > When I pull the power plug, I see the text ?Im In Battery? > instantly, instead of after 20s. Power returned after 55 seconds. > Could I be missing some dependency, external application, which > upsmon uses as a timer?upsmon does not handle timing, but instead delegates that to upssched. The scheduling happens inside nut-2.2.2/clients/upssched.c.> (A side issue is that it?s not using the correct variable when > passing to upssched-cmd, but uses the notify text itself, ?ONBATT?, > this can be seen in the last line from, messages, $1 is ?UPS > ups0 at localhost on line power?, but this is not important for me, but > may be used to explain why the timer is not working)Is your NOTIFYCMD in upsmon.conf set to upssched or upssched-cmd? It should be the former, I believe. upssched-cmd is specified as the CMDSCRIPT in upssched.conf.> > ONBATT > Dec 2 18:48:56 storage01 upsmon[3603]: ONBATT > Dec 2 18:48:56 storage01 wall[4371]: wall: user root broadcasted 1 > lines (8 chars) > Dec 2 18:48:56 storage01 upssched-cmd: Im On BatteryCan you raise the logging level to include LOG_INFO? There are a few upssched messages whose timestamps might shed some light on the subject.
Not really when looking over the documentation and the posts on the OpenFiler web site and google. I can only guess that somewhere in the documentation / posts I saw a reference to upssched-cmd and never realized there was a upssched as well. As the script did fire, but ignoring the timer value, I did not suspect I was using the wrong one. JJ -----Original Message----- From: Charles Lepple [mailto:clepple at gmail.com] Sent: 4. desember 2009 23:06 To: John Jore Cc: nut-upsuser at lists.alioth.debian.org Subject: Re: [Nut-upsuser] Timers fireing too early On Dec 4, 2009, at 2:49 PM, John Jore wrote:> Hi Charles and thanks for your insight and help. > That was the error, upssched vs upssched-cmd. I specified the wrong > one. All ok now.Glad it is working for you now. Is there anything specific you think we should adjust in the documentation?