Forum Discussion

L_W's avatar
L_W
Icon for Nimbostratus rankNimbostratus
Jun 30, 2020

EAV Monitor For Multiple Sites.

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

1 Reply

  • Can you try like that ?

     

    for i in 1 2

    do

    curl -Nsk https://$HOST/v/$i/endpoint$i | grep -i "${RECV}" 2>&1 > /dev/null

    done