Hi all I?m not sure if this is the right place to post but I?m at wits end. So here we go. Running opensuse 11 with two ups that can be seen via web interface and post messages on the console. My issue lies in trying to get the upssched and upsmon to work correctly. Currently I have the exec flags denoted in the upsmon and ?NOTIFYCMD /usr/sbin/upssched? is specified as the NOTIFYCMD flag as well since this is where is could fin the file. In upssched I have ?CMDSCRIPT /usr/bin/upssched-cmd? for the script file. Finally upssched-cmd looks like the following. #! /bin/sh # # This script should be called by upssched via the CMDSCRIPT directive. # # Here is a quick example to show how to handle a bunch of possible # timer names with the help of the case structure. # # This script may be replaced with another program without harm. # # The first argument passed to your CMDSCRIPT is the name of the timer # from your AT lines. case $(1) in onbattwarn) WALL "UPS is down fix me please" echo "TIM_UPS is on Battery for more then 10 seconds" \ | mailx -r "ups at fit.edu" -s"Tim_ups on Battery" tarbeite at fit.edu ;; esac Also I am calling the time in upssched as ?AT ONBATT * EXECUTE onbattwarn? Any idea as to why nothing works when I pull the cord on the UPS? I can provide more info if needed. Thanks ~Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20080916/7d752d71/attachment.htm
Citeren tarbeite <tarbeite at fit.edu>:> Running opensuse 11 with two ups that can be seen via web interface and post > messages on the console.Please post the contents of /etc/ups/upssched.conf here. Also make sure that the directory mentioned in PIPEFN and LOCKFN exists and is writeable by the user running upssched (typically 'upsd' on openSUSE). Best regards, Arjen -- Eindhoven - The Netherlands Key fingerprint - 66 4E 03 2C 9D B5 CB 9B 7A FE 7E C1 EE 88 BC 57
On Tue, Sep 16, 2008 at 03:12:22PM -0400, tarbeite wrote:> Hi all. . <stuff> . .> > case $(1) in > onbattwarn) > WALL "UPS is down fix me please" > echo "TIM_UPS is on Battery for more then 10 seconds" \ > | mailx -r "[1]ups at fit.edu" -s"Tim_ups on Battery" > [2]tarbeite at fit.edu > ;; > esacIn the above `case $(1) in' should be `case ${1} in' or just `case $1 in', because the shell would elicit an error otherwise. Insert `exec > /tmp/errors.log 2>&1' at the begining of the script to save error messages to the file noted for debugging. -- John