time in own cdefs - sum of some ds

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
User avatar
undefine
Posts: 6
Joined: Mon Jun 30, 2008 8:51 am
Location: Poznan, Poland
Contact:

time in own cdefs - sum of some ds

Post by undefine »

i have 5 datasources:
a, b, c, d and e.

I want create graph with 4 graphs:
- sum of a+b
- sum of c+d
- sum of above
- e

howto do it?
i can't use ALL_DATA_SOURCES_NODUPS nor ALL_DATA_SOURCES because it sums all DS - i can't sum only a+b etc.

I created 3 new CDEFs - which sum a+b, c+d and all.
It works, but - last read is very often 0 on graphs.

I look howto ALL_DATA_SOURCES works - it it's somethinkg like:
TIME,1215293369,GT,a,a,UN,0,a,IF,IF
- current time - 300 seconds is compared with time of last read, and it return 0 or UN.

I think it should help with my 0 on graph. But how create my own CDEF with current time?

Thanks for any suggestions
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: time in own cdefs - sum of some ds

Post by gandalf »

undefine wrote:i have 5 datasources:
a, b, c, d and e.

I want create graph with 4 graphs:
- sum of a+b
- sum of c+d
- sum of above
- e

howto do it?
i can't use ALL_DATA_SOURCES_NODUPS nor ALL_DATA_SOURCES because it sums all DS - i can't sum only a+b etc.
So I assume, that a,b do NOT refer to a SIMILAR_DATA_SOURCE (e.g. both refer to traffic_in)?
I created 3 new CDEFs - which sum a+b, c+d and all.
It works, but - last read is very often 0 on graphs.

I look howto ALL_DATA_SOURCES works - it it's somethinkg like:
TIME,1215293369,GT,a,a,UN,0,a,IF,IF
- current time - 300 seconds is compared with time of last read, and it return 0 or UN.

I think it should help with my 0 on graph. But how create my own CDEF with current time?
There's been some hazzle around this for a while. RRDTOOL seems to change this behaviour every now and then. At least, lately there was a discussion about it in the rrdtool mailing lists. So this might be called an rrdtool bug with a workaround like the above.
The times are taken from php code; there's no explicit interface to it. You may use RRDTOOL TIME pseudo-variable, but I fear this won't help
Reinhard
User avatar
undefine
Posts: 6
Joined: Mon Jun 30, 2008 8:51 am
Location: Poznan, Poland
Contact:

Re: time in own cdefs - sum of some ds

Post by undefine »

gandalf wrote:
undefine wrote:i have 5 datasources:
a, b, c, d and e.

I want create graph with 4 graphs:
- sum of a+b
- sum of c+d
- sum of above
- e

howto do it?
i can't use ALL_DATA_SOURCES_NODUPS nor ALL_DATA_SOURCES because it sums all DS - i can't sum only a+b etc.
So I assume, that a,b do NOT refer to a SIMILAR_DATA_SOURCE (e.g. both refer to traffic_in)?
no, all of them are different types. (and it's just example - "real" graph is much more complex)
I created 3 new CDEFs - which sum a+b, c+d and all.
It works, but - last read is very often 0 on graphs.

I look howto ALL_DATA_SOURCES works - it it's somethinkg like:
TIME,1215293369,GT,a,a,UN,0,a,IF,IF
- current time - 300 seconds is compared with time of last read, and it return 0 or UN.

I think it should help with my 0 on graph. But how create my own CDEF with current time?
There's been some hazzle around this for a while. RRDTOOL seems to change this behaviour every now and then. At least, lately there was a discussion about it in the rrdtool mailing lists. So this might be called an rrdtool bug with a workaround like the above.
The times are taken from php code; there's no explicit interface to it. You may use RRDTOOL TIME pseudo-variable, but I fear this won't help
Reinhard
TIME didn't help me, because it's only time of last read - and i didn't have current time to compare with it.
I found how this contruction is created but i wonder why current time and "$seconds_between_graph_updates" isn't available just like yet another special data source to compare with TIME (time of last read).
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: time in own cdefs - sum of some ds

Post by gandalf »

undefine wrote:...but i wonder why current time and "$seconds_between_graph_updates" isn't available just like yet another special data source to compare with TIME (time of last read).
Perhaps because no one asked for it? A feature request?
But again, if it is "only" to work around an rrdtool "error", I wonder if we should do so
Reinhard
Last edited by gandalf on Mon Jul 07, 2008 2:48 am, edited 1 time in total.
User avatar
undefine
Posts: 6
Joined: Mon Jun 30, 2008 8:51 am
Location: Poznan, Poland
Contact:

Re: time in own cdefs - sum of some ds

Post by undefine »

gandalf wrote:
undefine wrote:...but i wonder why current time and "$seconds_between_graph_updates" isn't available just like yet another special data source to compare with TIME (time of last read).
Perhaps because on one asked for it? A feature request?
good point :) i though that cacti already have such feature. Now i reported feature request: http://bugs.cacti.net/view.php?id=1275
But again, if it is "only" to work around an rrdtool "error", I wonder if we should do so
Reinhard
i think current time can have a little more application, for example to show only "last" part of graph and don't show any historicial datas.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests