开发者

RRDtool bad format problem

开发者 https://www.devze.com 2023-01-18 16:36 出处:网络
I\'m using RRDtool for graphing some monitoring information. One problem I faced when using rrd is using GRPINT directive. I use following command to graph networking Rx/Tx data:

I'm using RRDtool for graphing some monitoring information. One problem I faced when using rrd is using GRPINT directive. I use following command to graph networking Rx/Tx data:

rrdtool graph out.png -v bytes -a PNG --start "-6 hour" --title "WLAN traffic" \
    --vertical-label="Bit/s" \
    'DEF:_rx=/root/ppp0.rrd:rx:AVERAGE' \
    'DEF:_tx=/root/ppp0.rrd:tx:AVERAGE' \
    'CDEF:tx=_tx,-8,*' \
    'CDEF:rx=_rx,8,*' \
    'COMMENT:WLAN traffic\j' \
    "AREA:rx开发者_如何学运维#333333:WLAN Rx" \
    "AREA:tx#990000:WLAN Tx" \
    'GPRINT:rx:AVERAGE:"Rx average - %d"' \
    'GPRINT:tx:AVERAGE:"Tx average - %d"'

I've got:

ERROR: bad format for GPRINT in 'Rx average - %d'

I tried to simplify format, but when I've got:

ERROR: bad format for GPRINT in '%d'

I understand that I doing something completely wrong. What's the problem?


Your %d format is for integers. GPRINT (and PRINT) only support double formats ... see man sprintf for inspiration. Try %.0lf for starters.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号