I tried that one but neglected to mention it in my post. I actually got an RPN error using it. It did seem to sum only one half of the data sources, but the exact error was:
Invalid RPN expression: ,8,*
Not sure what caused it, but I think it's an internal issue with the SIMILAR_DATA_SOURCES_NODUPS data source.
I could construct my custom CDEFs in a similar fashion and have them work if there were a way to pull an actual timestamp value out of Cacti into a CDEF function to use in conjunction with the RPN 'TIME' operator. Do you know of a way to do that?
Strange behavior for LAST
Moderators: Developers, Moderators
The solution in the post you referenced could also be solved. The Cacti developers already solved it partially within their Total All Sources custom data source -- but they haven't included the ability to write a dynamic timestamp into the CDEF as of current.
For the current time, I propose that I:
Create a data source on the graph itself which utilizes a custom CDEF function:
timecdef=TIME,300,-
And then reference this CDEF in my aggregation CDEFs as used with Cacti, a la:
TIME,timecdef,GT,a,a,UN,0,a,IF,IF
For aesthetics, I believe Cacti should support a custom data source in the form of that timestamp used in total data sources for graphs which need a bit more granular control of which data sources are being combined (Cacti currently seems to have an all or none approach). Does that sound reasonable?
For the current time, I propose that I:
Create a data source on the graph itself which utilizes a custom CDEF function:
timecdef=TIME,300,-
And then reference this CDEF in my aggregation CDEFs as used with Cacti, a la:
TIME,timecdef,GT,a,a,UN,0,a,IF,IF
For aesthetics, I believe Cacti should support a custom data source in the form of that timestamp used in total data sources for graphs which need a bit more granular control of which data sources are being combined (Cacti currently seems to have an all or none approach). Does that sound reasonable?
By the way, the solution referenced in the other post, they probably used a standard summation for the LAST/Current value in the form of:
a,b,+,c,+
This will also fail for the last value if any of the current values were unknown. The solution used by the summation functions in Cacti is better, even if it isn't perfect and more difficult to implement (due to the lack of feature availability).
a,b,+,c,+
This will also fail for the last value if any of the current values were unknown. The solution used by the summation functions in Cacti is better, even if it isn't perfect and more difficult to implement (due to the lack of feature availability).
I modified my original CDEFs instead of making a new one. The following works (though it cuts off the past 5 minutes of data from the graph):
TIME,TIME,300,-,GT,a,a,UN,0,a,IF,IF
b,UN,0,b,IF,+
etc...
For those who may read this later, what happens is as follows:
Get values for the current time and subtract five minutes (300 seconds) for another time-stamp; if the time-stamp of the data is within the past five minutes, consider the original data value (unsanitized for conversion of unknowns to zeros), otherwise, consider the sanitized value (0 for unknowns).
CDEF appears to work in my graphs, displays LAST values in the graph view as well as the console view.
Edit: This is to update: it is only required to do the TIME manipulations on the first value in the CDEF function. If it is considered unknown, it will sum to an unknown for the entire graph regardless of the other values.
TIME,TIME,300,-,GT,a,a,UN,0,a,IF,IF
b,UN,0,b,IF,+
etc...
For those who may read this later, what happens is as follows:
Get values for the current time and subtract five minutes (300 seconds) for another time-stamp; if the time-stamp of the data is within the past five minutes, consider the original data value (unsanitized for conversion of unknowns to zeros), otherwise, consider the sanitized value (0 for unknowns).
CDEF appears to work in my graphs, displays LAST values in the graph view as well as the console view.
Edit: This is to update: it is only required to do the TIME manipulations on the first value in the CDEF function. If it is considered unknown, it will sum to an unknown for the entire graph regardless of the other values.
Who is online
Users browsing this forum: No registered users and 8 guests