Forum Discussion
OTS02
Cirrus
Aug 24, 2015SNI External Monitor for ADFS
Kevin Stewart solved the mystery of why my built-in GTM monitor would not work against our ADFS servers (https://devcentral.f5.com/questions/monitor-for-adfs-server-gtm). The ADFS servers require SNI...
Kevin_Stewart
Employee
Aug 25, 2015It seems the while loop inside getscript() was looping indefinitely, which only appears to happen as part of the monitor. Here's a minor tweak:
!/bin/bash
pidfile="/var/run/$MONITOR_NAME.$1..$2.pid"
if [ -f $pidfile ]
then
kill -9 -`cat $pidfile` > /dev/null 2>&1
fi
echo "$$" > $pidfile
node_ip=`echo $1 |sed 's/::ffff://'`
node_port=$2
getscript () {
echo 'GET / HTTP/1.1'
echo 'Host: adfs.open-techs.com'
echo ''
sleep 1
echo 'quit\n'
}
docurl () {
IFS=$'\n'
arr=($(getscript | openssl s_client -connect ${node_ip}:${node_port} -cipher 'ECDHE-RSA-AES256-SHA' -servername 'adfs.open-techs.com' 2>/dev/nul |grep -E '200 OK'))
unset IFS
}
docurl
echo ${arr[0]}
if [ -n "${arr[0]}" ]
then
Remove the pidfile before the script echoes anything to stdout and is killed by bigd
rm -f $pidfile
echo "up"
fi
Remove the pidfile before the script ends
rm -f $pidfile
You may have to adjust the sleep statement depending on the application server's response.
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