Created
April 6, 2016 16:10
-
-
Save lukebigum/9735c2556a1106008672108737eb1dc2 to your computer and use it in GitHub Desktop.
Awk script for PTPd stats
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
BEGIN {"hostname" | getline hstnm ; }; | |
{ | |
#one_way_delay | |
a = $4 | |
v = gensub(/ /, "", "g", a) | |
print "PUTVAL " hstnm "/one_way_delay/precise_time_offset interval=1 N:" v*1000000000 | |
#offset_from_master | |
a = $5 | |
v = gensub(/ /, "", "g", a) | |
print "PUTVAL " hstnm "/offset_from_master/precise_time_offset interval=1 N:" v*1000000000 | |
#slave_to_master | |
b = $6 | |
v = gensub(/ /, "", "g", b) | |
print "PUTVAL " hstnm "/slave_to_master/precise_time_offset interval=1 N:" v*1000000000 | |
#master_to_slave | |
b = $7 | |
v = gensub(/ /, "", "g", b) | |
print "PUTVAL " hstnm "/master_to_slave/precise_time_offset interval=1 N:" v*1000000000 | |
#observed_drift | |
b = $8 | |
v = gensub(/ /, "", "g", b) | |
print "PUTVAL " hstnm "/observed_drift/precise_frequency_offset interval=1 N:" v | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment