[Nut-upsuser] Unitek iZi UPS 525

Ciprian Vizitiu cvizitiu at gbif.org
Tue Dec 26 12:01:25 CET 2006


 
> > 2.0.3 is biting me bad in the upssched department so I 
> guess I'll have 
> > to go for SVN. :-(
> 
> Like how? There have not been too many major bugs in upssched 
> and as far as I know this has not changed significantly (if 
> at all) since nut-2.0.3.
> Could you please describe what is not working for you here? 
> This may be just a configuration error or something more 
> sinister which requires work from the developers.

Heh, I thought you'll never ask. o:-)

Ok, most likely it's me but I'm out of ideas right now; last night my very
first attempt was to use "NOTIFYCMD" with 

NOTIFYFLAG ONLINE SYSLOG+WALL+EXEC
NOTIFYFLAG ONBATT SYSLOG+WALL+EXEC
NOTIFYFLAG LOWBATT SYSLOG+WALL+EXEC

... and the very simple script for sending mails worked just fine. So upsmon
is actually taking into consideration "NOTIFYCMD" section. 

Next step was to try and add upssched to the very same script. No luck;
reading the 4th time the doc, I've figured out that upssched must be the
NOTIFYCMD param in order to work, apparently it can't be inside the script.
So right now I have in upsmon.conf:

RUN_AS_USER nut

NOTIFYCMD /usr/sbin/upssched

NOTIFYFLAG ONLINE SYSLOG+WALL+EXEC
NOTIFYFLAG ONBATT SYSLOG+WALL+EXEC
NOTIFYFLAG LOWBATT SYSLOG+WALL+EXEC

Before you ask:

-rwxr-xr-x 1 root root 21316 Jul 12 21:09 /usr/sbin/upssched*

Ok, upssched.conf:

CMDSCRIPT /usr/sbin/upssched-cmd

PIPEFN /var/run/upssched/upssched.pipe
LOCKFN /var/run/upssched/upssched.lock

AT ONBATT Unitek at localhost START-TIMER onbattwarn 60
AT ONLINE Unitek at localhost CANCEL-TIMER onbattwarn


Ok, pipe folder first: 

drwxrwxrwx 2 nut nut 4096 Dec 26 00:46 /var/run/upssched

The script itself:

-rwxrwxrwx 1 nut nut 501 Dec 26 10:51 /usr/sbin/upssched-cmd*

... I know, I know, I know; but I've ended up 777-ing everything just to see
it working! :-@

The script now looks like this:

#! /bin/bash
#

#case $1 in
#       onbattwarn)

#/usr/sbin/upsmon -c fsd

echo 'Booo' > /tmp/upstest

#               ;;
#       *)
#               logger -t upssched-cmd "Unrecognized command: $1"
#               ;;
#esac

Of course I've started with tons of "events" :-) then trimmed down to one
event and in the end... To my eyes it looks like "It should work!"(TM) but
for some reasons it doesn't, the script is never called. If I pull the plug
I get the SYSLOG and WALLs for the events but no EXECs. If I wait for the
battery depletion everything is fine but this is exactly what I'm trying to
avoid: battery depletion in one shot. 


BTW: It takes this Unitek UPS some 1 min to decide that the power is back.
Scary so to say, at first it looks as if the system will never come back
on-line after a power down. The displayed values for this timing are way
smaller:

# upsrw Unitek at localhost
[...]

[ups.delay.start]
Interval to wait before (re)starting the load (seconds)
Type: STRING
Value: 3

Isn't that "3" supposed to mean "3 seconds"? Apparently not...




More information about the Nut-upsuser mailing list