Created
November 19, 2015 21:45
-
-
Save growse/24796c871f2cb32effc1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
TIME=$((1000000000* `date +%s`)) | |
curl -XPOST http://storebot.growse.com:8086/write?db=main --data-binary $"chrony_systemtimeoffset,host=`hostname` value=`chronyc tracking |grep 'System time'|cut -f 2 -d ':'|sed 's/ *\([0-9\.]*\) seconds \(slow\|fast\) of NTP time/\2\1/g'|sed 's/slow/-/'|sed 's/fast//'` $TIME | |
chrony_frequency,host=`hostname` value=`chronyc tracking |grep 'Frequency'|cut -f 2 -d ':'|sed 's/ *\([0-9\.]*\) ppm \(slow\|fast\)/\2\1/g'|sed 's/slow/-/'|sed 's/fast//'` $TIME" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment