External Custom Monitor Script Help
We have 5 different pools representing different service ports i.e. 8085, 8087, 8088, 8089 and 8091.
I have created a external custom shell script to monitor all these service ports.
The script is :
!/bin/sh
CHANNEL_RECV = normal (the expected channel response (not case sensitive))
GATEWAY_RECV = normal (the expected gateway response (not case sensitive))
SPACE_RECV = normal (the expected space response (not case sensitive))
NODE=`echo $1 | sed 's/::ffff://'`
pidfile="/var/run/umps_monitor.pid"
if [ -f $pidfile ]
then
kill -9 `cat $pidfile` > /dev/null 2>&1
fi
channel_status=`curl -fNs http://${NODE}:8085/api/channel/admin/monitor -d "data={xyz}" | sed 's/.*health":"\([^"]*\).*/\1/g' | grep -i "${CHANNEL_RECV}"`
gateway_status=`curl -fNs http://${NODE}:8085/api/gateway/admin/monitor -d "data={xyz}" | sed 's/.*health":"\([^"]*\).*/\1/g' | grep -i "${GATEWAY_RECV}"`
space_status=`curl -fNs http://${NODE}:8085/api/space/admin/monitor -d "data={xyz}" | sed 's/.*health":"\([^"]*\).*/\1/g' | grep -i "${SPACE_RECV}"`
if [ "$channel_status" == "normal" -a "$gateway_status" == "normal" -a "$space_status" == "normal" ]
then
echo "UP"
exit 0
else
exit 1
fi
rm -f $pidfile
From the above script i can determine the health of all the service ports. i.e. port 8085 to which request goes.
/api/channel/admin/monitor gives the health of port 8088 service.
/api/gateway/admin/monitor gives the health of port 8087 service.
/api/space/admin/monitor gives the health of port 8089 service.
Now in each pool i have added this monitor with availability requirement set to 1. If any of the service port is down the node should be mark as completely down in all the pools.
Now I am seeing Pool member monitor status up and down again and again very frequently in /var/log/ltm. Is there is something wrong with the script or i am making too much monitor noise with F5.
Please help.
Thanks.