Bugs with CDEF "Total All Data Sources"

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

Moderators: Developers, Moderators

Post Reply
weissel
Posts: 2
Joined: Tue Apr 19, 2011 3:50 am

Bugs with CDEF "Total All Data Sources"

Post by weissel »

Hi all,

I'm using Cacti (0.8.7g with the official patches data_source_deactivate, graph_list_view, html_output, ldap_group_authentication, ping, poller_interval, script_server_command_line_parse) to graph data aggregated from several hosts, and I've found several strange behaviors with ALL_DATA_SOURCES_NODUPS.

1. GPRINT Average ALL_DATA_SOURCES_NODUPS gives inconsistent results:
Image

As you can see, the average of "Total All Data Sources" doesn't match with the straight addition of the 3 hosts (and the given number from "Total All Data Sources" looks wrong, too, it doesn't match the addition of the averages of the 3 single values). I suspect that this is due to the time check, as the values are consistent when I use time frames that don't include the beginning (not all hosts were added at exactly the same time, and there was fun getting the script to run correctly).

The graph debug is as follows:

Code: Select all

c:/cacti/rrdtool.exe graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="000test \"all sources\"" \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="" \
--slope-mode \
--font TITLE:12: \
--font AXIS:8: \
--font LEGEND:10: \
--font UNIT:8: \
DEF:a="C\:/Inetpub/wwwroot/cacti/rra/HOST1_count_1456.rrd":COUNT:AVERAGE \
DEF:b="C\:/Inetpub/wwwroot/cacti/rra/HOST2_count_1457.rrd":COUNT:AVERAGE \
DEF:c="C\:/Inetpub/wwwroot/cacti/rra/HOST3_count_1458.rrd":COUNT:AVERAGE \
CDEF:cdefg=TIME,1303203963,GT,a,a,UN,0,a,IF,IF,TIME,1303203963,GT,b,b,UN,0,b,IF,IF,TIME,1303203963,GT,c,c,UN,0,c,IF,IF,+,+ \
CDEF:cdefh=a,b,c,+,+ \
AREA:a#FF0000FF:"Host 1"  \
GPRINT:a:AVERAGE:"Host 1 Average\:%8.2lf %s\n"  \
AREA:b#2175D9FF:"Host 2":STACK \
GPRINT:b:AVERAGE:"Host 2 Average\:%8.2lf %s\n"  \
AREA:c#7EE600FF:"Host 3":STACK \
GPRINT:c:AVERAGE:"Host 3 Average\:%8.2lf %s\n"  \
GPRINT:cdefg:AVERAGE:"Average (Total All Data Sources)\:%8.2lf %s"  \
GPRINT:cdefh:AVERAGE:"Average (a,b,c,+,+)\:%8.2lf %s" 
Here is the same graph, zoomed to the very beginning of data recording. Observe how the average of all graphs is supposedly below the average of every single source:
Image


2. Adding a MAX line:
Image
leads to a broken graph. Debug:

Code: Select all

c:/cacti/rrdtool.exe graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="000test \"all sources\"" \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="" \
--slope-mode \
--font TITLE:12: \
--font AXIS:8: \
--font LEGEND:10: \
--font UNIT:8: \
DEF:a="C\:/Inetpub/wwwroot/cacti/rra/HOST1_count_1456.rrd":COUNT:AVERAGE \
DEF:b="C\:/Inetpub/wwwroot/cacti/rra/HOST2_count_1457.rrd":COUNT:AVERAGE \
DEF:c="C\:/Inetpub/wwwroot/cacti/rra/HOST3_count_1458.rrd":COUNT:AVERAGE \
CDEF:cdefg=TIME,1303204223,GT,a,a,UN,0,a,IF,IF,TIME,1303204223,GT,b,b,UN,0,b,IF,IF,TIME,1303204223,GT,c,c,UN,0,c,IF,IF,+,+ \
CDEF:cdefh=a,b,c,+,+ \
CDEF:cdefi= \
AREA:a#FF0000FF:"Host 1"  \
GPRINT:a:AVERAGE:"  Host 1 Average\:%8.2lf %s\n"  \
AREA:b#2175D9FF:"Host 2":STACK \
GPRINT:b:AVERAGE:"  Host 2 Average\:%8.2lf %s\n"  \
AREA:c#7EE600FF:"Host 3":STACK \
GPRINT:c:AVERAGE:"  Host 3 Average\:%8.2lf %s\n"  \
GPRINT:cdefg:AVERAGE:"Average (Total All Data Sources)\:%8.2lf %s"  \
GPRINT:cdefh:AVERAGE:"Average (a,b,c,+,+)\:%8.2lf %s"  \
LINE1:cdefi#000000FF:"Max Line" 
As you can see, CDEF:cedfi is broken.


A workaround in both cases is to use a custom CDEF (in this case "a,b,c,+,+") --- and changing the CDEF whenever you add or remove sources. I haven't yet seen what happens if some of the source data is undef, I suspect nothing good is going to happen.

Any ideas what I might have done wrong or interpreted incorrectly? Any additional data you need to look into the problem?
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Bugs with CDEF "Total All Data Sources"

Post by gandalf »

weissel wrote:Hi all,

I'm using Cacti (0.8.7g with the official patches data_source_deactivate, graph_list_view, html_output, ldap_group_authentication, ping, poller_interval, script_server_command_line_parse) to graph data aggregated from several hosts, and I've found several strange behaviors with ALL_DATA_SOURCES_NODUPS.

1. GPRINT Average ALL_DATA_SOURCES_NODUPS gives inconsistent results:
...I suspect that this is due to the time check,
That's correct. It has always been a discussion whether to include NaN or remove them from calculation
Here is the same graph, zoomed to the very beginning of data recording. Observe how the average of all graphs is supposedly below the average of every single source:
It's the same issue. This should resolve, when the zoom does not show NaN any more.
2. Adding a MAX line:
leads to a broken graph. Debug:
You did not add a MAX line, as no data source is associated.
R.
weissel
Posts: 2
Joined: Tue Apr 19, 2011 3:50 am

Re: Bugs with CDEF "Total All Data Sources"

Post by weissel »

gandalf wrote: You did not add a MAX line, as no data source is associated.
Uh --- I'm puzzled.

How do I add a line that shows the sum of all data sources using "Total All Data Sources" and using the MAX consolidation function, not the AVERAGE consolidation function?
With AVERAGE, I get a curve that looks OK.
With MAX, I get a broken graph.
With MAX and "a,b,c,+,+" I get a curve that looks OK (but I cannot tell yet if it is OK, I don't have enough data for the yearly graph at the moment --- the data has a daily pattern.)

I must be doing something wrong ...
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Bugs with CDEF "Total All Data Sources"

Post by gandalf »

weissel wrote:
gandalf wrote: You did not add a MAX line, as no data source is associated.
Uh --- I'm puzzled.

How do I add a line that shows the sum of all data sources using "Total All Data Sources" and using the MAX consolidation function, not the AVERAGE consolidation function?
With AVERAGE, I get a curve that looks OK.
With MAX, I get a broken graph.
With MAX and "a,b,c,+,+" I get a curve that looks OK (but I cannot tell yet if it is OK, I don't have enough data for the yearly graph at the moment --- the data has a daily pattern.)

I must be doing something wrong ...
In case you ONLY want MAX, change all data sources to use MAX.
Wen you need AVERAGE and MAX, then you will have to add two data sources where currently a single one is listed. To be honest, I never faced such a setup yet ...
R.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests