Bug? Cacti 0.8.8c Area Graph Not Working

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
DJHiP
Posts: 9
Joined: Mon Sep 08, 2014 1:53 am

Bug? Cacti 0.8.8c Area Graph Not Working

Post by DJHiP »

Not sure if I'm in the right spot for a potential bug or script issue, mods move it if I'm not :)

Have an issue adding an area plot to a graph with two data sources.

The first Area Plot draws correctly, The second Area Plot seems to keep drawing the first datasource, even though its been changed.

So This Template:
Image

Produces This Graph:
Image

With Debug of the graph being:

Code: Select all

RRDTool Command:

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start='-86400' \
--end='-300' \
--title='bdr3 - Traffic - "ath0" 00:27:22:10:30:' \
--rigid \
--base='1000' \
--height='120' \
--width='500' \
--alt-autoscale \
--vertical-label='Bytes per second' \
--slope-mode \
--font TITLE:10: \
--font AXIS:6: \
--font LEGEND:7: \
--font UNIT:6: \
DEF:a='/var/www/html/cacti/rra/bdr3_-_if_traffic_in_41.rrd':'traffic_in':AVERAGE \
DEF:b='/var/www/html/cacti/rra/bdr3_-_if_traffic_in_41.rrd':'traffic_out':AVERAGE \
LINE1:a#00CF00FF:'Inbound'  \
GPRINT:a:LAST:' Current\:%8.2lf%s'  \
GPRINT:a:AVERAGE:'Average\:%8.2lf%s'  \
GPRINT:a:MAX:'Maximum\:%8.2lf%s'  \
AREA:a#00CF0019:''  \
COMMENT:'Total In \: 26.6 GB\n'  \
LINE1:b#002A97FF:'Outbound'  \
GPRINT:a:LAST:'Current\:%8.2lf%s'  \
GPRINT:b:AVERAGE:'Average\:%8.2lf%s'  \
GPRINT:b:MAX:'Maximum\:%8.2lf%s'  \
AREA:a#002A9719:''  \
COMMENT:'Total Out\: 26.6 GB\n' 

RRDTool Says:

OK
If you look in the last part of the debug, the two AREA lines are using the same data source 'a', even though they are defined as different data sources in the template..

Let me know if I'm missing something obvious, but when I change either of the AREA lines in the template they both still stay as 'a'.
Attachments
graph_image.php.png
graph_image.php.png (28 KiB) Viewed 2300 times
GraphTemplate.PNG
GraphTemplate.PNG (24.43 KiB) Viewed 2300 times
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Re: Bug? Cacti 0.8.8c Area Graph Not Working

Post by BSOD2600 »

If you look at the Items associated to each Data Source in [Graph Item Inputs] (right under graph template items), do they match up for the traffic in/out?
DJHiP
Posts: 9
Joined: Mon Sep 08, 2014 1:53 am

Re: Bug? Cacti 0.8.8c Area Graph Not Working

Post by DJHiP »

Hey BSOD2600,

Yeah they do, here are the screenshots :)
Attachments
GraphTemplate.PNG
GraphTemplate.PNG (28.11 KiB) Viewed 2279 times
GraphItemInput-In.PNG
GraphItemInput-In.PNG (23.88 KiB) Viewed 2279 times
GraphItemInput-Out.PNG
GraphItemInput-Out.PNG (23.99 KiB) Viewed 2279 times
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Re: Bug? Cacti 0.8.8c Area Graph Not Working

Post by BSOD2600 »

Odd.

What if you moved the AREA items above the GPRINT items for both in/out?
DJHiP
Posts: 9
Joined: Mon Sep 08, 2014 1:53 am

Re: Bug? Cacti 0.8.8c Area Graph Not Working

Post by DJHiP »

Simply moving them up so they are like this:
GraphTemplateAboveGprint.PNG
GraphTemplateAboveGprint.PNG (24.58 KiB) Viewed 2270 times
Gives this result in RRDTool Debug (You don't really need the picture of the graph, you can see it's still calling 'a' for both Area's)

Code: Select all

RRDTool Command:

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start='-86400' \
--end='-300' \
--title='bdr3.gspv.wan - IF - Traffic - "ath0" 00:27:22:10:30:' \
--rigid \
--base='1000' \
--height='120' \
--width='500' \
--alt-autoscale \
--vertical-label='Bytes per second' \
--slope-mode \
--font TITLE:10: \
--font AXIS:6: \
--font LEGEND:7: \
--font UNIT:6: \
DEF:a='/var/www/html/cacti/rra/bdr3_gspv_wan_-_if_traffic_in_41.rrd':'traffic_in':AVERAGE \
DEF:b='/var/www/html/cacti/rra/bdr3_gspv_wan_-_if_traffic_in_41.rrd':'traffic_out':AVERAGE \
AREA:a#00CF0019:''  \
LINE1:a#00CF00FF:'Inbound'  \
GPRINT:a:LAST:' Current\:%8.2lf%s'  \
GPRINT:a:AVERAGE:'Average\:%8.2lf%s'  \
GPRINT:a:MAX:'Maximum\:%8.2lf%s'  \
COMMENT:'Total In \: 41.1 GB\n'  \
AREA:a#002A9719:''  \
LINE1:b#002A97FF:'Outbound'  \
GPRINT:a:LAST:'Current\:%8.2lf%s'  \
GPRINT:b:AVERAGE:'Average\:%8.2lf%s'  \
GPRINT:b:MAX:'Maximum\:%8.2lf%s'  \
COMMENT:'Total Out\: 41.1 GB\n' 

RRDTool Says:

OK

I've even tried putting the AREA lines at the very top, you still get

Code: Select all

DEF:a='/var/www/html/cacti/rra/bdr3_gspv_wan_-_if_traffic_in_41.rrd':'traffic_in':AVERAGE \
DEF:b='/var/www/html/cacti/rra/bdr3_gspv_wan_-_if_traffic_in_41.rrd':'traffic_out':AVERAGE \
AREA:a#00CF0019:''  \
AREA:a#002A9719:''  \
LINE1:a#00CF00FF:'Inbound'  \
GPRINT:a:LAST:' Current\:%8.2lf%s'  \
GPRINT:a:AVERAGE:'Average\:%8.2lf%s'  \
GPRINT:a:MAX:'Maximum\:%8.2lf%s'  \
COMMENT:'Total In \: 41.1 GB\n'  \
LINE1:b#002A97FF:'Outbound'  \
GPRINT:a:LAST:'Current\:%8.2lf%s'  \
GPRINT:b:AVERAGE:'Average\:%8.2lf%s'  \
GPRINT:b:MAX:'Maximum\:%8.2lf%s'  \
COMMENT:'Total Out\: 41.1 GB\n' 
The other thing I noticed is the second part of that code, the first GPRINT is also calling 'a' even though its mapped for the second data source...
DJHiP
Posts: 9
Joined: Mon Sep 08, 2014 1:53 am

Re: Bug? Cacti 0.8.8c Area Graph Not Working

Post by DJHiP »

I've just run the same setup through cacti 0.8.8a and got the same result.

Interestingly the gprint values are swapped compared to mine, but both area plots end up on 'a' just like 0.8.8c
GraphTemplate88a.PNG
GraphTemplate88a.PNG (27.55 KiB) Viewed 2263 times

Code: Select all

RRDTool Command:

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title='bdr3 - Traffic' \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale \
--vertical-label='Bytes per second' \
--slope-mode \
--font TITLE:12: \
--font AXIS:6: \
--font LEGEND:6: \
--font UNIT:6: \
DEF:a="/var/lib/cacti/rra/bdr3_traffic_in_5037.rrd":'traffic_out':AVERAGE \
DEF:b="/var/lib/cacti/rra/bdr3_traffic_in_5037.rrd":'traffic_in':AVERAGE \
LINE1:a#00CF00FF:"Inbound"  \
GPRINT:b:LAST:" Current\:%8.2lf%s"  \
GPRINT:b:AVERAGE:"Average\:%8.2lf%s"  \
GPRINT:a:MAX:"Maximum\:%8.2lf%s"  \
AREA:a#00CF0019:""  \
COMMENT:"Total In\: 83.28 GB\n"  \
LINE1:b#002A97FF:"Outbound"  \
GPRINT:a:LAST:"Current\:%8.2lf%s"  \
GPRINT:a:AVERAGE:"Average\:%8.2lf%s"  \
GPRINT:a:MAX:"Maximum\:%8.2lf%s"  \
COMMENT:"Total Out\: 2.24 GB"  \
AREA:a#002A9719:"" 

RRDTool Says:

OK

I'm trying to get my head around how it could be this template, but I keep coming back to the fact cacti shouldn't really care what's there, it should send it all to rrdtool and if its incorrect, rrdtool just won't display..
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Re: Bug? Cacti 0.8.8c Area Graph Not Working

Post by BSOD2600 »

Does the unaltered [bytes/sec, total bandwidth] graph show the correct data? For my 0.8.8c install, it does. If you then make a copy of that template and then add those 2 AREA items, does it break again?
DJHiP
Posts: 9
Joined: Mon Sep 08, 2014 1:53 am

Re: Bug? Cacti 0.8.8c Area Graph Not Working

Post by DJHiP »

As far as I'm aware the data is correct (It looks very similar to a second cacti instance I have running) So I'll assuming the polling and database data is fine, it's simply the front end.

So I duplicated the template, set the original back to how it was and it displays correctly for the original (Line for TX, Area for RX).
GraphTemplate(1).PNG
GraphTemplate(1).PNG (27.29 KiB) Viewed 2252 times
So I then duplicated the graph in question and went to change its template across to the new one and got this:
GraphPreviewConversion.PNG
GraphPreviewConversion.PNG (34.43 KiB) Viewed 2252 times
Notice Item #5 says Out, when it should be In, Item #11 has no task at all, and it wants to add #11 and #12 as the new items, even though #5 and #11 are the new items.

This is the graph debug of that template, which is even more interesting, EVERYTHING has moved to datasource 'a' now!

Code: Select all

RRDTool Command:

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start='-86400' \
--end='-300' \
--title='bdr4 Traffic (1)' \
--rigid \
--base='1000' \
--height='120' \
--width='500' \
--alt-autoscale-max \
--lower-limit='0' \
--vertical-label='Bytes per second' \
--slope-mode \
--font TITLE:10: \
--font AXIS:6: \
--font LEGEND:7: \
--font UNIT:6: \
DEF:a='/var/www/html/cacti/rra/bdr4_traffic_in_24.rrd':'traffic_out':AVERAGE \
LINE1:a#00CF00FF:'Inbound'  \
GPRINT:a:LAST:' Current\:%8.2lf %s'  \
GPRINT:a:AVERAGE:'Average\:%8.2lf %s'  \
GPRINT:a:MAX:'Maximum\:%8.2lf %s'  \
AREA:a#00CF0019:''  \
COMMENT:'Total In \: 1.67 MB\n'  \
LINE1:a#002A97FF:'Outbound'  \
GPRINT:a:LAST:'Current\:%8.2lf %s'  \
GPRINT:a:AVERAGE:'Average\:%8.2lf %s'  \
GPRINT:a:MAX:'Maximum\:%8.2lf %s'  \
AREA:a#002A9719:''  \
COMMENT:'Total Out\: 1.67 MB\n' 

RRDTool Says:

OK
So I guess what I'm now going to have try is to build the template from nothing at all, possibly there is some stuck code in this template? (Not that I can see how that could happen, cacti somewhat sanitises the template when you import?)
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Re: Bug? Cacti 0.8.8c Area Graph Not Working

Post by BSOD2600 »

Seems like a nice bug you've found with repro ;) Please report it http://www.cacti.net/bugs.php
DJHiP
Posts: 9
Joined: Mon Sep 08, 2014 1:53 am

Re: Bug? Cacti 0.8.8c Area Graph Not Working

Post by DJHiP »

Bug Submitted... http://bugs.cacti.net/view.php?id=2535

Thanks for your persistence BSOD2600 :)
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests