Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


[HOWTO] Sexy Traffic Graphs
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cacti Forum Index -> Informational/HOWTO's
Author Message
ptaylor874



Joined: 04 Jan 2008
Posts: 26

PostPosted: Wed Jan 23, 2008 1:10 am    Post subject: [HOWTO] Sexy Traffic Graphs Reply with quote

Ok - Maybe not "Sexy", but better looking...

I've not used Cacti for very long, so perhaps this is a common thing people do that I've not seen, but I thought I'd let everyone else know anyhow.

Personally, I didn't like the default Traffic Graphs in Cacti. I just upgraded to version 0.8.7a, and found that I had the new opacity features, so I played around with them for quite some time, but just couldn't come up with two areas that looked decent when they overlapped. Finally, I came upon a graph on (of all things) a political website that looked great and gave me an idea...

Graph the same data twice - Once as a 100% opaque line, and again as an area with 10% opacity. This would (at least in theory) give a nice solid edge to the lightly colored area, and the areas would blend together fairly well. (I first did this on a different graph and used red and blue - Makes a nice purple!) The Green and Blue don't blend quite as nicely, but it still looks very good.



ishot-1.png
 Description:
Sexy Traffic Graph
 Filesize:  51.91 KB
 Viewed:  30424 Time(s)

ishot-1.png



ishot-3.png
 Description:
Configuration screenshot
 Filesize:  24.77 KB
 Viewed:  30424 Time(s)

ishot-3.png


Back to top
gandalf
Developer


Joined: 02 Dec 2004
Posts: 17009
Location: Muenster, Germany

PostPosted: Wed Jan 23, 2008 7:39 am    Post subject: Reply with quote

Thank you for your contribution. But you definitively should turn green into deep red to make it more sexy
Reinhard
Back to top
LightwaveNet



Joined: 23 Jan 2007
Posts: 2

PostPosted: Thu Jan 31, 2008 9:46 am    Post subject: export template please Reply with quote

Can someone who has implemented this export a graph template for it please. I seem to have goofed. (or some other change I made recently borked everything.) Trying to narrow down which :p

Oh finaly found it. I forgot to add a color to the traffic_out line added :p
Back to top
hosierd



Joined: 09 Jun 2004
Posts: 19
Location: Rockville, Maryland

PostPosted: Mon Mar 24, 2008 1:29 pm    Post subject: Re: [HOWTO] Sexy Traffic Graphs Reply with quote

[/quote]Graph the same data twice - Once as a 100% opaque line, and again as an area with 10% opacity. This would (at least in theory) give a nice solid edge to the lightly colored area, and the areas would blend together fairly well. (I first did this on a different graph and used red and blue - Makes a nice purple!) The Green and Blue don't blend quite as nicely, but it still looks very good.[/quote]

Great looking graphs! Thanks for the tip.

How did you get the legend to line up so well ?

Thanks.

Doug
Back to top
gandalf
Developer


Joined: 02 Dec 2004
Posts: 17009
Location: Muenster, Germany

PostPosted: Mon Mar 24, 2008 4:43 pm    Post subject: Re: [HOWTO] Sexy Traffic Graphs Reply with quote

hosierd wrote:
How did you get the legend to line up so well ?
Check <HR> of the last Graph Item.
Reinhard
Back to top
wishbone



Joined: 14 Dec 2006
Posts: 5

PostPosted: Tue Mar 25, 2008 12:30 am    Post subject: Re: [HOWTO] Sexy Traffic Graphs Reply with quote

hosierd wrote:

Great looking graphs! Thanks for the tip.

How did you get the legend to line up so well ?

Thanks.

Doug


It's all in the font choice. You need to select a font that is very "monospaced".

BTW thanks for the tip. The graphs look VERY nice. As soon as the ubuntu packages catch up, I'll be trying this for sure.
Back to top
ben_c
Cacti User


Joined: 14 May 2007
Posts: 203
Location: Melbourne, Australia.

PostPosted: Tue Apr 08, 2008 9:34 pm    Post subject: Reply with quote

This is handy to know, but i'm interested if this increases processing load on the box as it has to render two lines instead of just the one line/area?

I always need to consider this with a large number of datasources.
Back to top
gandalf
Developer


Joined: 02 Dec 2004
Posts: 17009
Location: Muenster, Germany

PostPosted: Wed Apr 09, 2008 12:40 pm    Post subject: Reply with quote

ben_c wrote:
This is handy to know, but i'm interested if this increases processing load on the box as it has to render two lines instead of just the one line/area?

I always need to consider this with a large number of datasources.
IMHO, no problem. Graph rendering is done on request only. And you hopefully will never create all 16k graphs in one run
Reinhard
Back to top
Kilrathy



Joined: 27 Nov 2008
Posts: 9

PostPosted: Thu Dec 04, 2008 1:41 am    Post subject: Reply with quote

Okay, it's an very old thread, but maybe someone likes my "updated" version of sexy graph also!

What I added is, that my graphs has a positive and negative site - so outbound traffic is negativ and goes "down"
But first we need som preps:

First you need to create a new CDEF, as I always take graphs with Bits, I made a new CDEF "Turn Bytes into Bits -1" - as you see on the picture, the only thing I changed is a - in the front of the 8.



Second, we edit or duplicate, what ever you want, the graph template "Interface - Traffic (bits/sec)". For coloring you can do it like ptaylor874 described it.

Then change the Auto Scale Options to Use --alt-autoscale (ignoring given limits) as shown on the picture.



Third, you need to change for every(!) outgoing item the CDEF to your new created -8 CDEF in the first step.



Save your new graph template and look your results, if you did everything right (and I didn't miss someting ) you should have graphes like these:



Cheers,
Kilrathy
Back to top
gandalf
Developer


Joined: 02 Dec 2004
Posts: 17009
Location: Muenster, Germany

PostPosted: Sun Dec 07, 2008 2:09 pm    Post subject: Reply with quote

This looks nice, indeed.
My recommendation would be to add a LINE1 associated with the MAX CF of both in/out (out to the negative y-axis for sure). This way, you see both AVERAGEs (related to total traffic transferred) as well as MAX (related to top if usage) in one graph. The effect is seen on historical vies only.
This would be my favourite for the standard cacti traffic graph!
Reinhard
Back to top
danno



Joined: 16 Feb 2005
Posts: 14
Location: Boca Raton, FL

PostPosted: Mon Dec 15, 2008 1:24 pm    Post subject: Reply with quote

excellent work!

I have three remaining problems-

-I'm using the 95th percentile traffic, and I noticed that the numbers for the negative graphing are actually negative numbers, unlike yours. I'm looking for 95th percentile on both inbound outbound traffic separately. Maybe I'm asking for too much


- I can't get the equivalent 95th percentile line for the negative graphing to work properly... it just uses the 'positive' number and overlaps the actual

- The maximum outbound appears to give an incorrect amount.

Attached is a typical graph from where I'm currently at. I appreciate any insights offered.



graph_image.php.png
 Description:
typical display of my current configuration.
 Filesize:  30.35 KB
 Viewed:  19705 Time(s)

graph_image.php.png


Back to top
Findarato



Joined: 06 Feb 2008
Posts: 19

PostPosted: Tue Dec 16, 2008 2:34 pm    Post subject: Reply with quote

you dont have to change the legend's values to -, just the graphing parts.
Back to top
danno



Joined: 16 Feb 2005
Posts: 14
Location: Boca Raton, FL

PostPosted: Tue Dec 16, 2008 4:39 pm    Post subject: Reply with quote

done. That changes the hard values- thanks!
Back to top
hamish



Joined: 05 Aug 2008
Posts: 26
Location: London

PostPosted: Fri Jan 09, 2009 10:57 am    Post subject: Reply with quote

Does anyone else get borked graph definitions when you edit existing graph templates to make them look like this?

I've had endless problems with graphs that stop working when I add lines or transparent areas that are duplicates of existing data templates... Mostly ahere the graph seems to lose the link between the data template and the data query... Or is it that the data query loses the link between the data template and the XML attribute...

Anyway... It's B:L*&^Y annoying...

H
Back to top
danno



Joined: 16 Feb 2005
Posts: 14
Location: Boca Raton, FL

PostPosted: Fri Jan 09, 2009 1:12 pm    Post subject: Reply with quote

Are you sure to place it all in the right order? Not saying I would know that misordering it would cause the problem, but just being sure that you have it in order anyway.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Informational/HOWTO's All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 



Powered by phpBB © 2001, 2005 phpBB Group