"Interface - Traffic" graph template problem

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

Moderators: Developers, Moderators

jberanek
Posts: 16
Joined: Fri Jul 25, 2008 6:10 am

"Interface - Traffic" graph template problem

Post by jberanek »

Using Cacti 0.8.7d (was until today using 0.8.7b, but the issue wasn't fixed by my upgrade)

Recently my "Interface - Traffic" graph template has become incorrectly formatted, and no matter what I do to it I can't fix it. Maybe someone here can point me in the right direction.

I attach a few files, the first of which, graph.png, shows the problem. The "Outbound" legend item appears on the same line as the "Inbound" one, disregarding the order shown in the template. It also appears before the "Total In:" comment.

The second file, graph_template.png, shows the template.

The final information I can provide, is the rrdtool command. This clearly shows the error (the graph items are in the wrong order), but I don't know how to go about correcting it...

Code: Select all

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="heb-cvs - Traffic - eth0" \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="bits per second" \
--slope-mode \
--font TITLE:12:/usr/share/fonts/bitstream-vera/VeraMono.ttf \
--font AXIS:7:/usr/share/fonts/bitstream-vera/VeraMono.ttf \
--font LEGEND:7:/usr/share/fonts/bitstream-vera/VeraMono.ttf \
--font UNIT:7:/usr/share/fonts/bitstream-vera/VeraMono.ttf \
DEF:a="/export/home/Admin/website/cgi-bin/cacti/rra/heb-cvs_traffic_in_2273.rrd":traffic_in:AVERAGE \
DEF:b="/export/home/Admin/website/cgi-bin/cacti/rra/heb-cvs_traffic_in_2273.rrd":traffic_in:LAST \
DEF:c="/export/home/Admin/website/cgi-bin/cacti/rra/heb-cvs_traffic_in_2273.rrd":traffic_in:MIN \
DEF:d="/export/home/Admin/website/cgi-bin/cacti/rra/heb-cvs_traffic_in_2273.rrd":traffic_in:MAX \
DEF:e="/export/home/Admin/website/cgi-bin/cacti/rra/heb-cvs_traffic_in_2273.rrd":traffic_out:AVERAGE \
DEF:f="/export/home/Admin/website/cgi-bin/cacti/rra/heb-cvs_traffic_in_2273.rrd":traffic_out:LAST \
DEF:g="/export/home/Admin/website/cgi-bin/cacti/rra/heb-cvs_traffic_in_2273.rrd":traffic_out:MIN \
DEF:h="/export/home/Admin/website/cgi-bin/cacti/rra/heb-cvs_traffic_in_2273.rrd":traffic_out:MAX \
CDEF:cdefa=a,8,* \
CDEF:cdefb=b,8,* \
CDEF:cdefd=d,8,* \
CDEF:cdefe=e,8,* \
CDEF:cdefg=f,8,* \
CDEF:cdefi=h,8,* \
AREA:cdefa#00CF00FF:"Inbound"  \
GPRINT:cdefb:LAST:" Curr\:%8.2lf %s"  \
GPRINT:cdefa:AVERAGE:"Avg\:%8.2lf %s"  \
GPRINT:cdefd:MAX:"Max\:%8.2lf %s"  \
LINE1:cdefe#002A97FF:"Outbound"  \
COMMENT:"Total In\:  670.09 MB\n"  \
GPRINT:cdefg:LAST:"Curr\:%8.2lf %s"  \
GPRINT:cdefe:AVERAGE:"Avg\:%8.2lf %s"  \
GPRINT:cdefi:MAX:"Max\:%8.2lf %s"  \
COMMENT:"Total Out\: 11.3 GB" 
Many thanks for any help, this is driving me nuts. :)

John.
Attachments
Faulty graph output
Faulty graph output
graph.png (19.56 KiB) Viewed 4359 times
Graph template screenshot
Graph template screenshot
graph_template.png (153.57 KiB) Viewed 4359 times
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Please check the HR checkbox of the last graph item and verify again
Reinhard
jberanek
Posts: 16
Joined: Fri Jul 25, 2008 6:10 am

Post by jberanek »

gandalf wrote:Please check the HR checkbox of the last graph item and verify again
Reinhard
Thanks for your reply - that doesn't seem to change anything visually.

John.

Code: Select all

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="heb-cvs - Traffic - eth0" \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="bits per second" \
--slope-mode \
--font TITLE:12:/usr/share/fonts/bitstream-vera/VeraMono.ttf \
--font AXIS:7:/usr/share/fonts/bitstream-vera/VeraMono.ttf \
--font LEGEND:7:/usr/share/fonts/bitstream-vera/VeraMono.ttf \
--font UNIT:7:/usr/share/fonts/bitstream-vera/VeraMono.ttf \
DEF:a="/export/home/Admin/website/cgi-bin/cacti/rra/heb-cvs_traffic_in_2273.rrd":traffic_in:AVERAGE \
DEF:b="/export/home/Admin/website/cgi-bin/cacti/rra/heb-cvs_traffic_in_2273.rrd":traffic_out:AVERAGE \
CDEF:cdefa=a,8,* \
CDEF:cdefe=b,8,* \
AREA:cdefa#00CF00FF:"Inbound"  \
GPRINT:cdefa:LAST:" Curr\:%8.2lf %s"  \
GPRINT:cdefa:AVERAGE:"Avg\:%8.2lf %s"  \
GPRINT:cdefa:MAX:"Max\:%8.2lf %s"  \
LINE1:cdefe#002A97FF:"Outbound"  \
COMMENT:"Total In\:  686.16 MB\n"  \
GPRINT:cdefe:LAST:"Curr\:%8.2lf %s"  \
GPRINT:cdefe:AVERAGE:"Avg\:%8.2lf %s"  \
GPRINT:cdefe:MAX:"Max\:%8.2lf %s"  \
COMMENT:"Total Out\: 18.92 GB\n" 
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

This is very strange and did not happen to me yet. So please verify again from Graph management that this graph is still related to that very Graph Template you're changing. Or change any other entry to verify that the change is propagated to the graph
Reinhard
jberanek
Posts: 16
Joined: Fri Jul 25, 2008 6:10 am

Post by jberanek »

gandalf wrote:This is very strange and did not happen to me yet. So please verify again from Graph management that this graph is still related to that very Graph Template you're changing. Or change any other entry to verify that the change is propagated to the graph
Reinhard
Attached another screenshot showing the graph setup (verifying the graph template chosen) and the graph debug.

John.
Attachments
graph_debug.png
graph_debug.png (155.27 KiB) Viewed 4043 times
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Well, the templates looks fine. The graph is weird but matches the (broken) rrdtool graph command. So the question is: why is the template correct but the graph broken?

Did you recently change the template?
Please export the template and post it here for me to verify
Reinhard
jberanek
Posts: 16
Joined: Fri Jul 25, 2008 6:10 am

Post by jberanek »

gandalf wrote:Well, the templates looks fine. The graph is weird but matches the (broken) rrdtool graph command. So the question is: why is the template correct but the graph broken?

Did you recently change the template?
Please export the template and post it here for me to verify
Reinhard
I don't remember changing it and then seeing it broken - it could be I did though...

Template attached - it's different from the default template because it's got "total bandwidth" figures like the default "Interface - Traffic (bits/sec, Total Bandwidth)" template. I added these because I kept creating graphs with the "Interface - Traffic (bits/sec)" template and got graphs without the total bandwidth, which I wanted.

(I didn't add dependencies to the export for brevity - I can add these if you like)

John.
Attachments
cacti_graph_template_interface_-_traffic_bitssec.xml
Graph template
(7.98 KiB) Downloaded 151 times
jberanek
Posts: 16
Joined: Fri Jul 25, 2008 6:10 am

Post by jberanek »

Hmm, that's interesting - if I do change one graph to the "Interface - Traffic (bits/sec, Total Bandwidth)" template, the display is fixed...

Attached is that template.

John.
Attachments
cacti_graph_template_interface_-_traffic_bitssec_total_bandwidth.xml
Total traffic graph template
(8.02 KiB) Downloaded 174 times
jberanek
Posts: 16
Joined: Fri Jul 25, 2008 6:10 am

Post by jberanek »

jberanek wrote:Hmm, that's interesting - if I do change one graph to the "Interface - Traffic (bits/sec, Total Bandwidth)" template, the display is fixed...

Attached is that template.

John.
A diff of these 2 files doesn't show much significant change to me - only a few sequence numbers different (in the "outbound" figures)...

John.
jberanek
Posts: 16
Joined: Fri Jul 25, 2008 6:10 am

Post by jberanek »

Hmm, one further piece of information.

If I change a graph to the "total bandwidth" template, and then change it straight back to the "normal" one, the graphs is _also_ fixed!

John.
jberanek
Posts: 16
Joined: Fri Jul 25, 2008 6:10 am

Post by jberanek »

OK, last post this evening, honest!

After this the graphs all went odd, as the attached image shows.

This appears to be to do with inappropriate data sources being used in the rrdtool command:

Code: Select all

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="admin-1 - Traffic - eth0" \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="bits per second" \
--slope-mode \
--font TITLE:12:/usr/share/fonts/bitstream-vera/VeraMono.ttf \
--font AXIS:7:/usr/share/fonts/bitstream-vera/VeraMono.ttf \
--font LEGEND:7:/usr/share/fonts/bitstream-vera/VeraMono.ttf \
--font UNIT:7:/usr/share/fonts/bitstream-vera/VeraMono.ttf \
DEF:a="/export/home/Admin/website/cgi-bin/cacti/rra/admin1_traffic_in_334.rrd":traffic_in:AVERAGE \
DEF:b="/export/home/Admin/website/cgi-bin/cacti/rra/admin1_traffic_in_334.rrd":traffic_out:AVERAGE \
CDEF:cdefa=a,8,* \
CDEF:cdefg=b,8,* \
AREA:cdefa#00CF00FF:"Inbound"  \
GPRINT:cdefa:LAST:" Curr\:%8.2lf%s"  \
GPRINT:cdefa:AVERAGE:"Avg\:%8.2lf%s"  \
GPRINT:cdefa:MAX:"Max\:%8.2lf%s"  \
COMMENT:"Total In\:  2.54 GB\n"  \
LINE1:cdefa#002A97FF:"Outbound"  \
GPRINT:cdefg:LAST:"Curr\:%8.2lf%s"  \
GPRINT:cdefg:AVERAGE:"Avg\:%8.2lf%s"  \
GPRINT:cdefg:MAX:"Max\:%8.2lf%s"  \
COMMENT:"Total Out\: 2.54 GB\n" 
Note how both the green AREA and the blue LINE1 use "cdefa"...

John.
Attachments
Odd graph
Odd graph
graph_oddness.png (29.1 KiB) Viewed 3997 times
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

jberanek wrote:Template attached - it's different from the default template because it's got "total bandwidth" figures like the default "Interface - Traffic (bits/sec, Total Bandwidth)" template. I added these because I kept creating graphs with the "Interface - Traffic (bits/sec)" template and got graphs without the total bandwidth, which I wanted.
What was the base template used? Did you copy a base template or create this one from scratch.

Indeed, the sequence number issue is what I was looking for.

Reinhard
jberanek
Posts: 16
Joined: Fri Jul 25, 2008 6:10 am

Post by jberanek »

gandalf wrote:
jberanek wrote:Template attached - it's different from the default template because it's got "total bandwidth" figures like the default "Interface - Traffic (bits/sec, Total Bandwidth)" template. I added these because I kept creating graphs with the "Interface - Traffic (bits/sec)" template and got graphs without the total bandwidth, which I wanted.
What was the base template used? Did you copy a base template or create this one from scratch.

Indeed, the sequence number issue is what I was looking for.

Reinhard
I'm pretty sure I took the standard "Interface - Traffic (bits/sec)" graph template, and then added the extra bits from the "Interface - Traffic (bits/sec, Total Bandwidth)" template by hand.

John.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

That would be the required procedure. When changing the related graph template for those graphs back and forth, does this give you "good" graphs?
Reinard
jberanek
Posts: 16
Joined: Fri Jul 25, 2008 6:10 am

Post by jberanek »

gandalf wrote:That would be the required procedure. When changing the related graph template for those graphs back and forth, does this give you "good" graphs?
Reinard
Not really - many of my graphs have now messed up "Inbound Data Source" and "Outbound Data Source" - typically both showing the same data source, but I've also just seen one where the data sources were reversed, but the graph looked like both data sources were actually the same.

I'm a bit baffled, and dispirited that I might have to go and manually edit 331 graphs!

John.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests