tags:

views:

17

answers:

1

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?

A: 

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

Tobi Oetiker
Thanks a lot. It's just works!
dotsid