Creating total plot on 95th percentile traffic graph

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

Moderators: Developers, Moderators

Post Reply
mgleadow
Posts: 4
Joined: Thu Mar 01, 2007 3:40 am

Creating total plot on 95th percentile traffic graph

Post by mgleadow »

Hi

I have modified one of my Graph templates to combine useful features into one graph - I want traffic in bytes with total, in and out all plotted together, a 95th percentile line, and total data over the graph period all shown on the same template.

I have the graphs looking exactly how I want, but on closer inspection the total value being calculated consists of (outbound + outbound + inbound) and I cannot find where the extra data is coming from. The total graph is drawn using the Total All Data Sources CDEF (cdef=ALL_DATA_SOURCES_NODUPS) and the graph template only lists 2 data sources which are only used where expected. Given this value is obviously incorrect I am not sure I can trust the 95th percentile value either.

Also when I try to add a Total Data item for the combined plot it will always show either the inbound or outbound Total Data, but this is less of an issue as adding two numbers together in my head is fairly easy really :-)

If anyone has any pointers to where I am going wrong I would be greatful.

Version:

0.8.6j
Operating System: unix
PHP SNMP Support: yes

Patches:

ping_php_version4_snmpgetnext.patch
thumbnail_graphs_not_working.patch
tree_console_missing_hosts.patch

RRDtool Command:

Code: Select all

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="Public Switch - Port 24 - Uplink" \
--base=1000 \
--height=200 \
--width=625 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="bytes per second" \
DEF:a="/var/www/cacti/htdocs/rra/public_switch_traffic_in_31.rrd":traffic_out:AVERAGE \
DEF:b="/var/www/cacti/htdocs/rra/public_switch_traffic_in_31.rrd":traffic_in:AVERAGE \
CDEF:cdefa=TIME,1172740250,GT,a,a,UN,0,a,IF,IF,TIME,1172740250,GT,a,a,UN,0,a,IF,IF,TIME,1172740250,GT,b,b,UN,0,b,IF,IF,+,+ \
AREA:cdefa#96E78A:"Combined"  \
GPRINT:cdefa:LAST:"Current\:%8.2lf%s"  \
GPRINT:cdefa:AVERAGE:"Average\:%8.2lf%s"  \
GPRINT:cdefa:MAX:"Maximum\:%8.2lf%s\n"  \
LINE2:a#6EA100:"Outbound"  \
GPRINT:a:LAST:"Current\:%8.2lf%s"  \
GPRINT:a:AVERAGE:"Average\:%8.2lf%s"  \
GPRINT:a:MAX:"Maximum\:%8.2lf%s"  \
COMMENT:"Total Data: 8.53 GB\n"  \
LINE2:b#FFAB00:"Inbound"  \
GPRINT:b:LAST:" Current\:%8.2lf%s"  \
GPRINT:b:AVERAGE:"Average\:%8.2lf%s"  \
GPRINT:b:MAX:"Maximum\:%8.2lf%s"  \
COMMENT:"Total Data:  2.71 GB\n"  \
COMMENT:"\n"  \
HRULE:509075.6#FF0000:"95th Percentile"  \
COMMENT:"509.08 kB/s (in+out)\n" 
Screenshot and template attached below
Attachments
Screenshot
Screenshot
graph1.png (17.93 KiB) Viewed 1296 times
cacti_graph_template_interface_traffic_bytessec_total_bandwidth_95th.xml
Graph Template
(17.93 KiB) Downloaded 142 times
mgleadow
Posts: 4
Joined: Thu Mar 01, 2007 3:40 am

Post by mgleadow »

This afternoon I added another switch using the same template, and the numbers add up as expected. I then deleted and reinitialized the graphs and data sources for the original switch and suddenly everything worked. I have lost 2 days worth of data, but I am now getting valid numbers.

It would be interesting to know why the numbers were wrong, but it is not a pressing need now as everything is working as expected - sorry if this wasted anyone's time.
User avatar
TheWitness
Developer
Posts: 17064
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Gremlins. I don't feed them, or at least not in this section of the Code.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

I feed them... Well, I try to starve them... Apparently that isn't working.

The only thing I can think of is an incomplete data set in the RRDTool file. I don't know, I would have to see the broken file to figure it out.

Btw, I have a love/hate relationship with the Nth percentile code.

I love to hate it and it loves to hate me!! :o
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
mgleadow
Posts: 4
Joined: Thu Mar 01, 2007 3:40 am

Post by mgleadow »

Well for comparison here is the graph working as expected. Looking at it I think the 95th percentile code was being thrown out by the same error as the data transfer between 0200 and 0300 always follows the same pattern, and given it lasts for an hour the 95th percentile line should settle on this when the view is under 24 hours.

As it is fixed I'm not going to dig deeper, if I see it again I can dig the rrd files out for you. I've been playing with Cacti for a while and am just beginning to use it for a real purpose so I may be around here more in the future as I try to figure out all sorts of non-standard monitoring. It is certainly easier to manage than the last set of monitoring tools I used, namely mrtg and SystemStats2 (http://de-neef.net/SystemStats2/HomePage). mrtg is verv powerful but not the easiest to manage when you have large numbers of devices, and SystemStats2 is not very efficient in that it has to SSH to remote hosts to get the data. If I can work out how to do stuff such as monitoring per directory sizes and processes (not just overall count but also per process counts such as 35 Apache, 5 ssh, 10 bash etc) over SNMP I'll be laughing. If not I'll port the ssh scripts across I guess.
Attachments
graph2.png
graph2.png (15.42 KiB) Viewed 1263 times
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

If you are using NET-SNMP, look into the exec command for OID.. :)
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
mgleadow
Posts: 4
Joined: Thu Mar 01, 2007 3:40 am

Post by mgleadow »

That's a really helpful pointer, cheers!

Most of the stuff I need to do is as simple as adding (as an example):

exec duHome du -sk /home

to snmpd.conf and walking .1.3.6.1.4.1.2021.8
Last edited by mgleadow on Fri Mar 02, 2007 10:49 am, edited 1 time in total.
User avatar
TheWitness
Developer
Posts: 17064
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Page comes up "deleted". Please revise your post.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest