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 "[EMAIL PROTECTED]" -s"EC130 on battery"
[EMAIL PROTECTED]
;;
ec130combad)
echo "Communications to EC130 UPS have degraded." \
| mailx -r "[EMAIL PROTECTED]" -s"EC130 bad Communications"
[EMAIL PROTECTED]
;;
ec130cbatt)
echo "Battery in EC130 UPS needs to be replaced" \
| mailx -r "[EMAIL PROTECTED]" -s"EC130 bad battery"
[EMAIL PROTECTED]
;;
ec130lowbatt)
echo "Battery in EC130 UPS is low" \
| mailx -r "[EMAIL PROTECTED]" -s"EC130 low battery"
[EMAIL PROTECTED]
;;
#EC132 Commands
ec132onbatt)
echo "EC132 UPS has been on Battery for more then 10
seconds" \
| mailx -r "[EMAIL PROTECTED]" -s"EC132 on battery"
[EMAIL PROTECTED]
;;
ec132combad)
echo "Communications to EC132 UPS have degraded." \
| mailx -r "[EMAIL PROTECTED]" -s"EC130 bad Communications"
[EMAIL PROTECTED]
;;
ec132cbatt)
echo "Battery in EC132 UPS needs to be replaced" \
| mailx -r "[EMAIL PROTECTED]" -s"EC132 bad battery"
[EMAIL PROTECTED]
;;
ec132lowbatt)
echo "Battery in EC132 UPS is low: \
| Mailx -r "[EMAIL PROTECTED]" -s"EC132 low battery"
[EMAIL PROTECTED]
I have somewhere around 12 ups¹s that the server watches and would like to
thin out this code a little bit. Is there anyway to have UPSMON send a
command such as a COMMBAD * and then have upssched-cmd pickup the upsname
from the * and use it to send the approriate email.
Example being a communication error happens on ec132 and sends a commbad *
to upssched-cmd. I want upsched-cmd to then send the appriate email ³UPS
EC132 has bad communications² when this happens. I want to do this using
variables so that I only have to write the command out once for each event
instead of for each event 12 times.
Hopefully that made sense and pardon the length of the email
Thanks
~Tim
--
Timothy Arbeiter
Lead Lab Support Technician
Florida Institute of Technology
[EMAIL PROTECTED]
(321)674-8023
_______________________________________________
Nut-upsuser mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser