Forum Discussion
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
- mkahler_108475Historic F5 AccountYou are correct. The LTM will kill the monitor as soon as standard out is received. I think there used to be a wrapper sciprt that would capture standard out and allow the script to finish. Your recommendation is correct. Do your house keeping prior to writting to standard out.
- hoolioCirrostratusI thought we'd fixed that bug in all the codeshare entries, but apparently this one was missed. I updated it to remove the PIDFILE before echoing up.
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com