[Nut-upsuser] Variable use in upssched-cmd

tarbeite tarbeite at fit.edu
Wed Nov 5 16:53:58 UTC 2008


Thanks for the quick response, it pointed me in the right direction.
I apologize for my ignorance but I'm still a novice in Linux. My question is
how can this code below be accomplished using the variables mentioned by
Arjen?

ec228_commbad)
Echo "ec228 communications are bad" \
| mailx -r "ups at fit.edu" -s"EC228 cmm is bad" admin at email.com
;;

Thanks

~Tim





On 11/5/08 12:58 AM, "Charles Lepple" <clepple at gmail.com> wrote:

> On Tue, Nov 4, 2008 at 12:47 PM, tarbeite <tarbeite at fit.edu> wrote:
>> Hi all
>> 
>> I have most of the NUT system up and running. I'm in the process of writing
>> the script to send email notifications for certain events. This is my
>> upsshed-cmd file so far:
>> 
>> # EC130 Commands
>> 
>>         ec130onbatt)
>>                 echo "EC130 UPS has been on Battery for more then 10
>> seconds" \
>>                 | mailx -r "ups at fit.edu" -s"EC130 on battery"
>> tarbeite at fit.edu
>>                 ;;
>>         ec130combad)
>>                 echo "Communications to EC130 UPS have degraded." \
>>                 | mailx -r "ups at fit.edu" -s"EC130 bad Communications"
>> tarbeite at fit.edu
> 
> As an aside, you can use wildcards in case statements. I think the
> variables that Arjen pointed out should help, though.




More information about the Nut-upsuser mailing list