29-Jun-2020 20:38
I am trying to create an EAV Monitor that can monitor a site with different endpoints but the same hostname. For example,
Hostname = www.hostname.com
Endpoint1/URI1 = v/1/endpoint1
Endpoint2/URI2 = v/2/endpoint2
I am also looking at passing a receive string that will be unique to both endpoint if that will be possible.
I already have this curl command and I can't seem to get the loop working.
For U in $(URI);
do curl -fNsk --resolve $HOST:$PORT:$NODE https://$HOST$U | grep -i "${RECV}" > /dev/null 2>&1
# mark node UP if expected response was received
if [ $? -eq 0 ]
then
rm -f $PIDFILE
echo "UP"
else
rm -f $PIDFILE
fi
exit