Forum Discussion
Thales_92506
Nimbostratus
Sep 21, 2011How do i send emails when a monitor marks a pool down?
How is this possible?
Can I do this with EAV? Is it possible with logs?
Thanks
5 Replies
- hoolio
Cirrostratus
Hi Thales,
You can start here:
sol3667: Configuring alerts to send email notifications
http://support.f5.com/kb/en-us/solutions/public/3000/600/sol3667.html
Aaron - Thales_92506
Nimbostratus
Aaron, i´ve read this article.
My question is: how to link an EAV monitor to send emails when the pool member is marked down?
Thanks - Hamish
Cirrocumulus
If you're using an external monitor (i.e. a script), then you can just use the mail command to send an email. Or you can make it more generic and use the alert system to send emails based on the messages logged in the logfiles (As Aaron said above).
H - Thales_92506
Nimbostratus
Hamish, in the following code, if i put an else statement containing
email toaddress=""
fromaddress=""
body=""
would it work?
code:
remove IPv6/IPv4 compatibility prefix (LTM passes addresses in IPv6 format)
IP=`echo ${1} | sed 's/:
PORT=${2}
PIDFILE="/var/run/`basename ${0}`.${IP}_${PORT}.pid"
kill of the last instance of this monitor if hung and log current pid
if [ -f $PIDFILE ]
then
echo "EAV exceeded runtime needed to kill ${IP}:${PORT}" | logger -p local0.error
kill -9 `cat $PIDFILE` > /dev/null 2>&1
fi
echo "$$" > $PIDFILE
send request & check for expected response
curl -fNs http://${IP}:${PORT}${URI} | grep -i "${RECV}" 2>&1 > /dev/null
mark node UP if expected response was received
if [ $? -eq 0 ]
then
echo "UP"
fi
else [
email toaddress=""
fromaddress=""
body=""
]
fi
rm -f $PIDFILE
exit - Thales_92506
Nimbostratus
Figured this out.
Thanks
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects