Date: 01-01-07 02:25
when i configured my apcupsd, i saw the scripts are configured to send a message to root. i forward roots mail to my inbox, but:
1) i want the most important events to be forwarded to my cell phone as text message, and
2) i dont want to create any more sendmail aliases to include this person that person etc etc, just for the purpose of marshalling apc messages to appropriate places.
so, i made some small edits to some of the "event action" scripts located in /usr/local/etc/apcupsd/, as such:
# This shell script if placed in /etc/apcupsd
# will be called by /etc/apcupsd/apccontrol when the UPS
# goes on batteries.
# We send an email message to root to notify him.
MOBILE=[mycellphonenumber]@vtext.com #<-- Create Alias for my cell phone address
MSG="$HOSTNAME Power Failure !!!"
echo "Subject: $MSG"
echo " "
echo " "
) | $APCUPSD_MAIL -s "$MSG" $SYSADMIN $MOBILE #<-- Add my alias to recipients
i edited commfailure, commok, onbattery, and offbattery in this way, and now i
get the most important events sent to my cell phone as well.