我用我的raspi构建了NTP服务器,然后我使用MRTG来监控偏移和抖动,它工作正常。我刚刚在+1000的偏移值之前,负值可以显示出来。现在我想更改可以绘制负值的图形,所以我决定将MRTG与RRDTool一起使用,并遵循https://weberblog.net/basic-ntp-server-monitoring/?fbclid=IwAR3iV_rdwQK95axV8JWSmtBub9bhHtGbn9SGtLHSfSotsRXEVkO8YLuqZFM指南,但它不起作用。这是我的mrtg.cfg
WorkDir: /var/www/html/mrtg
LogFormat: rrdtool
Target[ntp2-gps-offset-us]: `ntpq -c rv ip | grep offset | sed s/.*$
MaxBytes[ntp2-gps-offset-us]: 100000
Title[ntp2-gps-offset-us]: Offset µs -- ntp2-gps
Options[ntp2-gps-offset-us]: gauge
Colours[ntp2-gps-offset-us]: DARKPURPLE#7608AA, Blue#0000FF, BLACK#000000, Purple#FF00FF
YLegend[ntp2-gps-offset-us]: Offset in microseconds (µs)
Legend1[ntp2-gps-offset-us]: Offset
Legend3[ntp2-gps-offset-us]: Peak Offset
LegendI[ntp2-gps-offset-us]: Offset:
ShortLegend[ntp2-gps-offset-us]: µs
PageTop[ntp2-gps-offset-us]: OFFSET MONITOR
routers.cgi*Options[ntp2-gps-offset-us]: fixunit nototal noo
routers.cgi*ShortDesc[ntp2-gps-offset-us]: Offset µs ntp2-gps
routers.cgi*Icon[ntp2-gps-offset-us]: graph-sm.gif
Target[ntp2-gps-jitter-us]: `ntpq -c rv ip | grep sys_jitter | sed $
MaxBytes[ntp2-gps-jitter-us]: 100000
Title[ntp2-gps-jitter-us]: Jitter µs -- ntp2-gps
Options[ntp2-gps-jitter-us]: gauge
Colours[ntp2-gps-jitter-us]: TURQUOISE#00CCCC, Blue#0000FF, DARKTURQUOISE#377D77, Purple#FF00FF
YLegend[ntp2-gps-jitter-us]: Jitter in microseconds (µs)
Legend1[ntp2-gps-jitter-us]: Jitter
Legend3[ntp2-gps-jitter-us]: Peak Jitter
LegendI[ntp2-gps-jitter-us]: Jitter:
PageTop[ntp2-gps-jitter-us]: <H1>JITTER MONITOR</H1>
ShortLegend[ntp2-gps-jitter-us]: µs
routers.cgi*Options[ntp2-gps-jitter-us]: fixunit nototal noo
routers.cgi*ShortDesc[ntp2-gps-jitter-us]: Jitter µs ntp2-gps
routers.cgi*Icon[ntp2-gps-jitter-us]: link-sm.gif
这是我的结果。enter image description here
发布于 2021-01-09 05:53:53
当MRTG创建RRD文件时,DS的最大/最小范围被设置为从0到MaxBytes。因此,为了允许存储负值(例如偏移量),您需要随后调优RRD文件以允许这样做。不幸的是,Tobi从未添加过MinBytes设置!
这将在targetname.rrd上设置'in‘值,允许的最小值为-1000000
rrdtool tune targetname.rrd --minimum ds0:-1000000
一旦你这样做了,那么它应该能够存储负值。
https://stackoverflow.com/questions/65621835
复制相似问题