Forum Discussion
NTP Health Monitor on V12
You'd have to create an external monitor of some kind. Something like
!/bin/bash
ip=${1}
ntpdate -q ${ip}
if [ $? -eq 0 ]
then
echo "UP"
fi
Whatever you echo should be the RECV= variable for the monitor. See https://devcentral.f5.com/articles/ltm-external-monitors-the-basics for info on setting up an external monitor. Script above is very basic, not very good error handling, making sure it isn't already running and so on. Could use some work. The basic is ntpdate will return non-0 if it wasn't able to query the ntp server.
I like your ntpdate based approach (+1). It looks upgrade safe to me compared to the Perl based monitor which requires a library import. (It used to get lost with a software update.) By default the ntpdate runs 4 polls. A single poll should be enough. The number of polls can be controlled via the -p paramter followed by a numerical value. A stratum of 1-15 should be okay. Thats why my current solution looks as follows:
!/bin/sh
ntpdate -q -p 1 ${1} 2> /dev/null | grep -Ewo 'stratum\s+([1-9]|1[0-5])' > /dev/null
return_codes="${PIPESTATUS[*]}"
if [ "${return_codes}" == "0 0" ]
then
echo "up"
fi
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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