From 04373b047c1dab852df045fcbcb950590fdf8af1 Mon Sep 17 00:00:00 2001 From: n Date: Tue, 1 May 2018 13:48:51 +0200 Subject: [PATCH] collectd graph for ntp_pool_score --- monitoring/collectd_ntppool_score | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 monitoring/collectd_ntppool_score diff --git a/monitoring/collectd_ntppool_score b/monitoring/collectd_ntppool_score new file mode 100755 index 0000000..9d9ad15 --- /dev/null +++ b/monitoring/collectd_ntppool_score @@ -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