How To Graph with Occasional NaN (OK)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

How To Graph with Occasional NaN (OK)

Patrick Best
Hi everyone;
 
I have a data source that occasionally provides a NaN.
 
This is OK for us, it’s expected about 20 times a day or so.
 
What we’d like to do is to eliminate “gaps” in the graph data, by using a technique like drawing a similar value as the last good poll.
 
Is there a way we can do this?
 
Is there a selector that can tell rrdgraph how to interpret NaN ?  Or would the mechanism be in the creation of the rrd?
 
 
 

_______________________________________________
rrd-users mailing list
[hidden email]
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
Have a great day!
Reply | Threaded
Open this post in threaded view
|

Re: How To Graph with Occasional NaN (OK)

Fredrik Wänglund-2
11.04.2012 15:00 skrev Patrick Best:

> Hi everyone;
>
> I have a data source that occasionally provides a NaN.
>
> This is OK for us, it's expected about 20 times a day or so.
>
> What we'd like to do is to eliminate "gaps" in the graph data, by
> using a technique like drawing a similar value as the last good poll.
>
> Is there a way we can do this?
>
> Is there a selector that can tell rrdgraph how to interpret NaN ? Or
> would the mechanism be in the creation of the rrd?


Can't you just increase the heartbeat to permit a longer time without
data before a NaN is recorded? Or is the Nan's dou to other reasons than
too long time between data samples?

_______________________________________________
rrd-users mailing list
[hidden email]
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
Reply | Threaded
Open this post in threaded view
|

Re: How To Graph with Occasional NaN (OK)

Patrick Best
The NaN value is expected to be recorded, and this is within the parameters.

I have since discovered that a CDEF can be used that may draw a NaN using the last-known-good reading.  I have found a posting under "graph magic" that indicates this is possible.

Now I need to understand how to work with CDEFs to create the desired effect (no gaps) when graphing.


http://linux.die.net/man/1/rrdtutorial

The 'nonans' CDEF is new, and the 6th line (which used to be the 5th line) used to read 'CDEF:kmh=myspeed,3600,*'
Have a great day!
Reply | Threaded
Open this post in threaded view
|

Re: How To Graph with Occasional NaN (OK)

Patrick Best
I am very much convinced that a CDEF will allow me to graph a NaN datapoint using a number from the last-known-good value that we have seen (as defined by a range, say <50000 ).

I am , however, not an expert on RPN (Reverse Polish Notation).

This seems like a CDEF that many people would like.  Sometimes counters do not rollover at predictable 32-bit or 64-bit positions, and in my case, a counter can rollover at any random spot, several times in a day.

I would appreciate some help from the community on coming up with a CDEF how to present NaN data as a continuation of the same last-known-good datapoint.

Tobi-wan, if you're out there, I could really use your help right now!


Regards,
Patrick


Have a great day!
Reply | Threaded
Open this post in threaded view
|

Re: How To Graph with Occasional NaN (OK)

S Shipway
You can do this using a CDEF.

What to graph depends on your preference.  If you want to mimic the behaviour of native-mode MRTG, for example, which uses the previous known value to replace a NaN, then just use something like:

CDEF:cleanx=x,UN,PREV,x,IF

(IF value of x is unknown, use PREVious value of cleanx, else use x)

Steve



Steve Shipway
ITS Unix Services Design Lead
University of Auckland, New Zealand
Floor 1, 58 Symonds Street, Auckland
Phone: +64 (0)9 3737599 ext 86487
DDI: +64 (0)9 924 6487
Mobile: +64 (0)21 753 189
Email: [hidden email]
 Please consider the environment before printing this e-mail


_______________________________________________
rrd-users mailing list
[hidden email]
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users

smime.p7s (8K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How To Graph with Occasional NaN (OK)

Patrick Best
Steve, thanks so much.  I will be trying that CDEF today.  Will post my results on this forum.

Thank you!

Have a great day!
Reply | Threaded
Open this post in threaded view
|

Re: How To Graph with Occasional NaN (OK)

Patrick Best
Success!  I was able to successfully use the CDEF of CDEF:cleanx=x,UN,PREV,x,IF to graph over NaN gaps.

Thanks very much!

Case closed.
Have a great day!
Reply | Threaded
Open this post in threaded view
|

Re: How To Graph with Occasional NaN (OK)

Patrick Best