95th Percentile Support in Cacti

Anything that you think should be in Cacti.

Moderators: Developers, Moderators

Post Reply
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

95th Percentile Support in Cacti

Post by raX »

Please forgive my cross-posting as I have already posted this to cacti-user in response to a question about ninety fifth percentile support in Cacti. I would love to hear some feedback from you guys about this one. Especially since you are going to be the ones using it for the most part.
I already have the backend code for this written, so that is all taken
care of. I am still pondering on how I want to implement this within
Cacti though. I can for see users wanting to display the 95th percentile
as an HRULE (in bytes/bits), or on the legend (in mbytes/mbits).

One of the ways to do this would be through variables in the text
format/value fields.

|95_bits|
|95_bytes|
|95_mbits|
|95_mbytes|

95th percentile will almost always be used on traffic graphs where there
is typically two data sources. Should the variables represent a
summation of the two data sources, or just the one referenced in the
current graph item?
-Ian
gregm
Posts: 38
Joined: Mon Oct 21, 2002 4:19 pm

Post by gregm »

It might make most sense to use a CDEF to do that, so then you get the flexibility of adding whatever you need. At the same time, this might be hard to implement .. i'm not really sure :p One thing you would want to avoid though is locking users into a specific way of doing things.
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

gregm wrote:It might make most sense to use a CDEF to do that, so then you get the flexibility of adding whatever you need. At the same time, this might be hard to implement .. i'm not really sure :p One thing you would want to avoid though is locking users into a specific way of doing things.
The biggest problem with this is that CDEF support is built into RRDTool and not Cacti. Therefore it is not possible for me to just add another CDEF function. RRDTool requires that you use at least one data source in your CDEF string, and this would not be possible when using internal variables.

Like you said, my goal here is to not limit how users can utilize this feature. Some will want to display it on their graphs, while others will want to draw horizontal lines based on the value. I am sure there are even more possibilities that I cannot think of...

-Ian
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

I am happy to say that the code is now written :D. Just to prove it, below is a graph I just rendered using Cacti:

Image

I decided upon the following sytax (in preg):

Code: Select all

|95:(bits|bytes):(\d):(current|total)\|
Which would look something like the following in your graph legend:

Code: Select all

|95:bits:6:current|
This displays the ninety fifth percentile for the current data source in mega (10^6) bits. I will be sure to include this in the manual.

-Ian
Strider
Posts: 19
Joined: Mon Jan 27, 2003 12:14 pm

Post by Strider »

Ian,
Need some help with the 95th %tile. Maybe it's a little too simple so it's not working for me. :)

Here's the steps I've taken:

- Graph Templates
- Select "Interface - Traffic (bits/sec)"
- Under Graph Template Items click on Add
- The following info is added:
Data Source: Traffic (traffic_out)
Graph Item Type: HRULE
Value: |95:bits:6:current|
Text Format: 95th Percentile: |95:bits:6:current|

When I go to graph display, I can see the line but it has a value of 0. I'm sure I'm doing something wrong.

BTW, I upgrade from 0.8 to 0.8.2 last night.

Thanks for any info.

-Mike
Elequin

Post by Elequin »

Strider wrote:When I go to graph display, I can see the line but it has a value of 0. I'm sure I'm doing something wrong.

BTW, I upgrade from 0.8 to 0.8.2 last night.

Thanks for any info.
-Mike
I'm having the same exact problem. I can not figure it out. I've tried different settings all over the place, but it's just not working. What I think the settings *should* be:

Data Source: Traffic (traffic_in)
Graph Item Type: HRULE
Consolidation Function: Average
CDEF Function: Turn Bytes into Bits
Value: |95:bits:6:current|
GPrint Type: Normal

I've changed Sequence all over the place, but I don't think it matters with HRULE. I even went into Inbound Data Source and added the HRULE. I've change the CDEF to none, I've tried different Consolidation Functions... It doesn't seem to matter. Not graphing.

Help!

- Eric
Elequin

Post by Elequin »

Figured it out. Make sure you add a Graph Item Input for the HRULE in Graph Templates, and then go to Graph Management and assign the Traffic In for the interface to the Graph Item Input in your graph.

For the HRULE in the Graph Template, I have:

Data Source: Traffic - In (traffic_in)
Graph Item Type: HRULE
Consolidation Function: Average
CDEF Function: None
Value: |95:bits:0:current|
GPRINT Type: Normal
Text Format: 95th Percentile: |95:bits:6:current| Mbit

Give it a try! :)

- Eric
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

I am glad you guys figured it out, sorry I didn't post sooner. Anyhow, for those of you that get a '0' result, remember that the 95th percentile function requires a decent amount of data to return any results.

-Ian
Strider
Posts: 19
Joined: Mon Jan 27, 2003 12:14 pm

Post by Strider »

I started with a fresh install instead of the upgrade. It has the option there for the Interface traffice 95th percentile which I used. I saw a bunch of things not right with my old setup... interfaces were not matching (example, the traffic in was different that the traffic out).

Anyway, if I have any problems now I'll post but I think it should be good.

Thanks for the info.

-Mike
ramiel
Posts: 2
Joined: Tue Aug 05, 2003 1:18 pm

Re: 95th Percentile Support in Cacti

Post by ramiel »

[quote="raX"]I would love to hear some feedback from you guys about this one. Especially since you are going to be the ones using it for the most part.

--

Hi, I have the latest version that comes with 95th installed. My company uses MRTG and we have a perl script that maintains 30 days worth of 5 min in/out averages of each router.

Next the perl script takes the router_port list of 30 days worth of 5 min samples, of each in/out number, it takes the greater one of the two, and sorts them.

next the top 5% is chopped off, and the remaining number is the 95th

This is the way how all Tier1 providers do bandwidth, however I noticed in the way cacti does it, it is doing in+out (that's what the HRULE said).

I would REALLY like to switch our company to use cacti with rrdtool, but I can't until we have this 95th thing working properly. Can you offer me any guidance?
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests