【问题标题】:MRTG with RRDTool have nothings show up带有 RRDTool 的 MRTG 没有任何显示
【发布时间】:2021-04-13 17:42:46
【问题描述】:

我用我的 raspi 构建了 NTP 服务器,然后我使用 MRTG 来监控 OFFSET 和 JITTER,它工作正常。 我之前的偏移值只是 +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

【问题讨论】:

  • 你真的应该使用 0.00001 的系数,然后让 mrtg/routers 负责显示正确的单位

标签: gps monitoring ntp rrdtool mrtg


【解决方案1】:

当 MRTG 创建 RRD 文件时,DS 的最大/最小范围设置为从 0 到 MaxBytes。因此,为了允许存储负值(例如偏移量),您需要随后调整 RRD 文件以允许这样做。不幸的是,Tobi 从未添加过 MinBytes 设置!

这会将 targetname.rrd 上的“in”值设置为允许最小值为 -1000000

rrdtool tune targetname.rrd --minimum ds0:-1000000

完成此操作后,它应该能够存储负值。

【讨论】:

    猜你喜欢
    • 2015-03-13
    • 2023-03-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-03-24
    • 2014-07-21
    • 2019-02-21
    • 2016-02-19
    相关资源
    最近更新 更多