Hi,
Does anyone have an example of a DNS external health monitor? The monitor should query an A record and check the IP address and provide up/down status based on the IP address matching a given/set IP address.
Thanks
Hi,
Please try this:
File name: hmdns
#!/bin/sh
domain=$1
IP=$2
check=`dig $domain @$HM_SRV_IPADDR | grep "$IP" | awk ' { print $5} '`
echo "check is $check; IP is $IP"
if [ $IP = $check ]; then
exit 0
fi
exit 1
ADC config for health monitor
health monitor hmdns
method external program checkdns arguments "aaa.bbb.ccc 1.1.1.1"
Send request (TYPE A) for FQDN aaa.bbb.ccc to DNS server and expect to see 1.1.1.1 is in the response