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:
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"
2. Adding a MAX line:
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"
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?