[Nut-upsuser] UPSSCHED and FreeBSD 8.3?

Daniel O'Connor doconnor at gsoft.com.au
Sat Jan 5 07:29:33 UTC 2013


On 05/01/2013, at 1:23, Thomas Laus <lausts at acm.org> wrote:
> I want to send an email to my cellphone only for significant UPS events that 
> involve starting the generator and want to ignore short duration events.
> 
> My upssched.conf:
> 
> CMDSCRIPT /usr/local/bin/upssched-cmd
> PIPEFN /var/db/nut/upssched/upssched.pipe
> LOCKFN /var/db/nut/upssched/upssched.lock
> AT ONBATT * START-TIMER upsbatt 30
> AT ONLINE * CANCEL-TIMER upsbatt
> AT LOWBATT * EXECUTE ups-low-batt
> 
> My CMDSCRIPT /usr/local/bin/upssched-cmd:
> 
> #!/bin/sh
> 
> case $1 in
>        upsbatt)
>                echo "The UPS has been on battery for awhile" \
>                | mail -s"UPS monitor" me at testhost.local
>                ;;
>        ups-low-batt)
>                echo "The UPS has a low battery condition" \
>                | mail -s"UPS monitor" me at testhost.local
>                ;;
>        *)
>                logger -t upssched-cmd "Unrecognized command: $1"
>                ;;
> esac
> 
> I tested the configuration last week before deployment by pulling the plug on 
> the UPS.  The syslog and wall notify commands work, but no email was 
> generated nor any entries in my maillog.

What about if you use the full path for mail? I don't know about the environment used - if it is very restrictive the mail executable might not be found.

--
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
  -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C






-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4358 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20130105/a1afb5af/attachment.bin>


More information about the Nut-upsuser mailing list