[rrd-users] [GRAYMAIL] Re: Block GPRINT when values not defined?
Robert C. Seiwert
rob at vca.com
Wed May 14 15:43:36 CEST 2014
1.48 is what I'm running. I will re-pull and test.
From: Steve Shipway [mailto:s.shipway at auckland.ac.nz]
Sent: Tuesday, May 13, 2014 11:55 PM
To: Robert C. Seiwert; rrd-users at lists.oetiker.ch
Cc: rrd-developers at lists.oetiker.ch
Subject: RE: [rrd-users] [GRAYMAIL] Re: Block GPRINT when values not defined?
> That sounds interesting and useful but not what we both asking for.
> I would be happy with unknown dates printing nothing at all, padded to the
> size of the requested format. What the OP complained about was the when
> the value is undefined/Unknown/NaN, strftime prints 1/1/1970 which would
> be correct if the date were known and it’s value was 0. For me at -5 UTC so
> it’s always New Years Eve (unless my disk array is going to run out of space
> then it’s 2014 ☹.
I've just taken a quick look at rrd_graph.c in v1.4.tunk and it seems that this should already be happening.
The function sets vf.never=1 when the time component is unknown, and if this is the case, then GPRINT should call time_clean rather than strtime and so you should get blank when the time would go. I can't see why you'd get it treated as 0, unless either you have an old version of RRDTool (which didn't have this check) or else there is a bug and vf.never is not getting set.
Possibly the code should treat a zero timeval as 'unknown', since who would want to print the date of the epoch anyway..?
If you're running on an older version of RRDTool, I'd suggest upgrading to the latest stable 1.4. You might find the problem goes away.
I do still like the idea of adding an option to GPRINT to specify an RPN test controlling if the print is added to the image or not; this would give a lot more control over the output. It's a bit complex for me to code up, though...
s.shipway at auckland.ac.nz
More information about the rrd-users