[rrd-developers] rrd_graph.c crashed on right Y-axis with SI units

Tobias Oetiker tobi at oetiker.ch
Sun Aug 12 22:49:37 CEST 2012


Hi Martin,

Today Martin Pelikan wrote:

> On Sun, Aug 12, 2012 at 08:50:52PM +0200, Tobias Oetiker wrote:
> > as long as you do not specify a format for the right axis labels,
> > they should autoscale ...
>
> Sorry, but as you can see here: http://lk.storkhole.cz/vole.png
> myself and this version disagree :-(

> $ rrdtool --version
> RRDtool 1.4.7  Copyright 1997-2012 by Tobias Oetiker <tobi at oetiker.ch>
>                Compiled Aug  9 2012 21:46:48
>
> Anyway, the destination system is OpenBSD; I managed to compile the
> latest SVN version, because the one in packages is 1.2.30, and after a
> while it worked (I'll send the patches separately).  An empty graph
> shows the right side scales (left is 0.0 - 1.0 and right 0m - 125m),
> but after it's been filled with data, it doesn't:
> http://lk.storkhole.cz/graph-svn-openbsd-filled.png

hmm so there seems to be a bug still ...
>
> I'll be working with the SVN version now; the script remained more or
> less the same (I know, the values are nonsense):
>
> TOOL=/opt/rrdtool-1.4.999/bin/rrdtool
> START=1307386800
>
> ${TOOL} graph vole.png --imgformat PNG -w 600 -h 400    \
>         -s ${START} -e start+1d                 \
>         --right-axis 0.125:0    \
>         DEF:tcpbts=moje.rrd:tcp_bytes:AVERAGE   \
>         DEF:udpbts=moje.rrd:udp_bytes:AVERAGE   \
>         DEF:up=moje.rrd:udp_packets:AVERAGE     \
>         DEF:tb=moje.rrd:tcp_bytes:AVERAGE       \
>         CDEF:icmpbts=tb,-1,*                    \
>         CDEF:udppkt=up,-1,*                     \
>         AREA:tcpbts#ff0000:"TCP bytes"          \
>         AREA:udpbts#00ff00:"UDP bytes"          \
>         LINE1:udppkt#0000ff:"UDP packets"       \
>         LINE1:icmpbts#00FFFF:"ICMP bytes"       \
>
>
> Thanks for your help so far.  First thing I noticed is that OpenBSD
> (and possibly others) doesn't have EPROTO in its errno.h, so I changed
> it to EINVAL, which is more common.  I know, it's in the POSIX.1-2008,
> but why not use something more common here?  What do you think?
> Should I rather try to push them a constant they don't use anywhere?

added an ifdef to the code

cheers
tobi

> Martin Pelikan
>
>
> Index: src/rrd_client.c
> ===================================================================
> --- src/rrd_client.c    (revision 2297)
> +++ src/rrd_client.c    (working copy)
> @@ -1495,7 +1495,7 @@
>    response_free (res);
>
>    if (head == NULL)
> -    return (EPROTO);
> +    return (EINVAL);
>
>    *ret_stats = head;
>    return (0);
>
>

-- 
Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten, Switzerland
http://it.oetiker.ch tobi at oetiker.ch ++41 62 775 9902 / sb: -9900



More information about the rrd-developers mailing list