PIDFILE cleanup broken in sample monitor?
I came across the above error after deploying an EAV monitor in LTM 10.2.3
After debugging and stepping through the script we were able to confirm that it never reaches the PIDFILE cleanup line on successful execution:
mark node UP if expected response was received
if [ $? -eq 0 ]
then
echo "UP"
fi
rm -f $PIDFILE
This appears to be 'normal' as result of any STDOUT generated by the script causing bigd to terminate the EAV process, as described in http://support.f5.com/kb/en-us/solu...l7444.html
In order to render the logged warning useful and only triggered under the condition where the script failed to exit, shouldn't we be removing the pidfile AFTER the test and BEFORE any output?
i.e.
mark node UP if expected response was received
if [ $? -eq 0 ]
then
rm -f $PIDFILE
echo "UP"
fi
rm -f $PIDFILE
or even cleanup before evaluation of the test error code (requires setting a var for the return code):
send request & check for expected response
curl -fNs http://${NODE}:${PORT}${URI} -d "${DATA}" | grep -i "${RECV}" 2>&1 > /dev/null
RC=$?
remove the pidfile, since the monitor executed
rm -f $PIDFILE
mark node UP if expected response was received
if [ $RC -eq 0 ]
then
echo "UP"
fi
exit
Is anyone else getting the same results or am I completely missing something here?
See also https://devcentral.f5.com/wiki/AdvDesignConfig.HTTPMonitor_cURL_BasicPOST.ashx
Matt