#!@@GOODSH@@ # -*- sh -*- : </dev/null | awk 'BEGIN { ev=1; } /^estimated error:/ { ev=0; } END { if (ev == 0) { print "yes";} else { print "no (command ntpq or ntpdc not found)"; } exit 0; }' exit 0 fi if [ "$1" = "config" ]; then echo 'graph_title NTP kernel PLL estimated error (secs)' echo 'graph_vlabel est. err (secs)' echo 'graph_category time' echo 'graph_info The kernels estimated error for the phase-locked loop used by NTP.' echo 'ntp_err.label est-error' echo 'ntp_err.info Estimated error for the kernel PLL' exit 0 fi printf 'ntp_err.value ' ntpq_name=$(ntpq -c version | sed 's/[^[:alpha:]].*//') ntpq_version=$(ntpq -c version | grep --extended-regexp --only-matching '[[:digit:]]\.[[:digit:]]\.[[:digit:]]') if [ "$ntpq_name" = "ntpq" ] && [ "$(echo "$ntpq_version" | tr -d '.')" -lt 427 ]; then ntpdc -c kerninfo | awk '/^estimated error:/ { printf("%.9f\n", $3) }' else ntpq -c kerninfo | awk '/^estimated error:/ { printf("%.9f\n", $3 / 1000) }' fi