various scripts for various tasks.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

collectd_ntppool_score 428B

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