Forum Discussion

pgroven_71837's avatar
pgroven_71837
Icon for Nimbostratus rankNimbostratus
Jan 09, 2008

HTTPMonitor_cURL_ProbeTimeout

I am not sure how to implement the sample monitor posted on DevCentral

 

I cannot use the http monitor as the string I need to recieve is longer than 5120 bytes

 

The following script should work but I don't know how to implement it

 

PIDFILE="/var/run/`basename ${0}`.${NODE}_${PORT}.pid"

 

kill of the last instance of this monitor if hung and log current pid

 

if [ -f $PIDFILE ]

 

then

 

kill -9 `cat $PIDFILE` > /dev/null 2>&1

 

fi

 

echo "$$" > $PIDFILE

 

 

CAUCHOPORT=4000

 

POOL=cwmp.stage.443

 

URI=/caucho-status

 

P_TIMEOUT=5

 

send request & check for expected response

 

for i in `seq 1 2`; do

 

curl -fNs -m ${P_TIMEOUT} http://w50-$i.c50.domain.com:${CAUCHOPORT}${URI} | grep -io "w50-$i"'.c50.domain.com:6802 .ok.' 2>&1 > /dev/null

 

exstatus=$?

 

echo "exstatus = $exstatus"

 

 

let bigd mark node UP if expected response was received

 

otherwise force the node DOWN immediately

 

if [ $exstatus -eq 0 ]

 

then

 

echo bigpipe pool ${POOL} member 10.50.1.$i up 2>&1 > /dev/null

 

else

 

echo bigpipe pool ${POOL} member 10.50.1.$i down 2>&1 > /dev/null

 

fi

 

 

rm -f $PIDFILE

 

done

 

exit

27 Replies