collectd graph for ntp_pool_score

This commit is contained in:
n 2018-05-01 13:48:51 +02:00
parent 9187a9dcb3
commit 04373b047c

View file

@ -0,0 +1,14 @@
#!/bin/sh
# add this to your types.db:
# ntp_pool_score value:GAUGE:-20:20
HOSTNAME="${COLLECTD_HOSTNAME:-`hostname -f`}"
INTERVAL="${COLLECTD_INTERVAL:-300}"
IP="X.X.X.X"
CURL="/usr/local/bin/curl"
while sleep "$INTERVAL"; do
VALUE=`$CURL --silent "http://www.pool.ntp.org/scores/$IP/log?limit=1" 2>&1 | tail -1 | cut -f 5 -d ","`
echo "PUTVAL $HOSTNAME/exec-magic/ntp_pool_score interval=$INTERVAL N:$VALUE"
done