Packetshaper templates

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

Moderators: Developers, Moderators

melchandra
Cacti User
Posts: 311
Joined: Tue Jun 29, 2004 12:52 pm
Location: Indiana

Packetshaper templates

Post by melchandra »

Here are some packetshaper templates that I created on Cacti version 0.8.6h. The packetshaper is running software version 7.2.3g1 although I am pretty sure that the templates will work with a varity of software versions on the packetshaper.

The zip file below contains all the exported xml files from cacti.

There are the data queries, which will present a list of all the (classes/partitions) much like the interface query does.

There are the data templates for class and partition data.

There are the graph templates for class and partition data.

Additionaly there is a custom graph I wrote that is a template to graph 8 of the classes. This custom graph stacks the differant classes on top of each other so you can see how differant classes compare to each other.

Import all but the "packetshaper_classes.xml", and the "packetshaper_partitions.xml". Those are the actual query definition XML files that go in the <cacti>/resource/snmp_queries/ path.
Attachments
Screenshot
Screenshot
packetshaper_top_classes.JPG (144.9 KiB) Viewed 22097 times
packetshaper_xml_files.zip
Zip file containing the XML export files from cacti.
(19.63 KiB) Downloaded 1642 times
Last edited by melchandra on Wed May 17, 2006 8:15 am, edited 2 times in total.
Dave
User avatar
chercen
Posts: 41
Joined: Sun Apr 09, 2006 4:16 pm
Location: Spain

Post by chercen »

Hello,

I have tried to import all these templates, but it does not work. When adding a device, I try the data query but all I get is a blank html page with:


Notice: Undefined index: oid_index in /var/www/cacti/lib/data_query.php on line 156

Notice: Undefined index: oid_index in /var/www/cacti/lib/data_query.php on line 159

Warning: Variable passed to each() is not an array or object in /var/www/cacti/lib/data_query.php on line 181

Warning: Variable passed to each() is not an array or object in /var/www/cacti/lib/data_query.php on line 515

Warning: Cannot modify header information - headers already sent by (output started at /var/www/cacti/lib/data_query.php:156) in /var/www/cacti/host.php on line 129


Also, if I clic on the "Data Query", "Associated Graph Templates", "PacketShaper Class Traffic" I get this error:

Warning: Variable passed to each() is not an array or object in /var/www/cacti/data_queries.php on line 356


Any help would be appreciated...

Regards,

Cesar
melchandra
Cacti User
Posts: 311
Joined: Tue Jun 29, 2004 12:52 pm
Location: Indiana

Post by melchandra »

I'm sorry. I forget to put the actual XML files in the archive. You will see two new XML files, they need to go in your <cacti>/resource/snmp_queries/ directory.

Try that and see if it works.

I apologize for the fact that this is my first time attempting to export stuff from cacti. It's a rather complicated process and there are a lot of inter-dependant things. So if anybody can point me to a how-to of exporting a complete set of data queries / data templates / graph templates, I would be most thankful.
Dave
chewbacca156
Posts: 24
Joined: Tue Apr 04, 2006 7:17 am

Post by chewbacca156 »

Thank you so much for theses templates.
It's working perfecty.

The only problem is that sometime the title is too long (because of the name of the class)...
melchandra
Cacti User
Posts: 311
Joined: Tue Jun 29, 2004 12:52 pm
Location: Indiana

Post by melchandra »

chewbacca156 wrote:The only problem is that sometime the title is too long (because of the name of the class)...
Yeah, I actually changed that around a lot before deciding on the longer title. Feel free to change it in the graph template.

We have a lot of class/subclass definitions on our packetshaper so it made sense to include the longer names as it helps to figure out what traffic really is. Otherwise I ended up with 6 graphs all with the class "SSL", instead of "SSL/HTTP", or "SSL/Default", etc etc. And I also changed the cacti option for maximum title length to 128.
Dave
User avatar
chercen
Posts: 41
Joined: Sun Apr 09, 2006 4:16 pm
Location: Spain

Post by chercen »

OK... thanks a lot..

However I still have a question: when you want to make a "top classes" graph, you clic "Create: Packetshaper Top Classes Template" and then "Create". The next screen asks you for three values:

- Index Type
- Index Value
- Output Type ID

As I didnt know what to type I just clicked "Save", and it worked. However, the graph didnt show anything.

If I want something to be graphed firstly I have to make some "Data queries", "SNMP - Packetshaper Classes", Create Graphs, choose which classes I want to graph and "Create". After doing this, I need to edit the Top Classes Graph, and choose 8 "Graph Item Fields" by hand: HTTP, FTP... Once finished, I get a nice graph similar to yours (posted one).

I do not know if all this works this way, maybe I am doing something wrong, since I do not know why the "Top Classes Template" asks me for those three values.

Is everything this OK? something wrong? is there any way to draw the top classes graph automatically, without having to graph firstly the classes you want to monitor?

Regards,

Cesar



melchandra wrote:I'm sorry. I forget to put the actual XML files in the archive. You will see two new XML files, they need to go in your <cacti>/resource/snmp_queries/ directory.

Try that and see if it works.

I apologize for the fact that this is my first time attempting to export stuff from cacti. It's a rather complicated process and there are a lot of inter-dependant things. So if anybody can point me to a how-to of exporting a complete set of data queries / data templates / graph templates, I would be most thankful.
melchandra
Cacti User
Posts: 311
Joined: Tue Jun 29, 2004 12:52 pm
Location: Indiana

Post by melchandra »

chercen wrote:OK... thanks a lot..

However I still have a question: when you want to make a "top classes" graph, you clic "Create: Packetshaper Top Classes Template" and then "Create". The next screen asks you for three values:

- Index Type
- Index Value
- Output Type ID

As I didnt know what to type I just clicked "Save", and it worked. However, the graph didnt show anything.

If I want something to be graphed firstly I have to make some "Data queries", "SNMP - Packetshaper Classes", Create Graphs, choose which classes I want to graph and "Create". After doing this, I need to edit the Top Classes Graph, and choose 8 "Graph Item Fields" by hand: HTTP, FTP... Once finished, I get a nice graph similar to yours (posted one).

I do not know if all this works this way, maybe I am doing something wrong, since I do not know why the "Top Classes Template" asks me for those three values.

Is everything this OK? something wrong? is there any way to draw the top classes graph automatically, without having to graph firstly the classes you want to monitor?

Regards,

Cesar
I'm not sure why it asked you for those values. It doesn't do that when I try to add the graph.

The top values template is just a container for 8 other classes. Cacti doesn't know anything about the packetshaper and what classes have the most traffic. It is just a way for you to pick 8 classes and see them all graphed on the same screen together. For that matter, you could pick any 8 classes and group them together. 8 differant p2p classes, 8 http classes, 8 ssl classes, 8 top classes, 8 whatever.... The graph template is just a container to graph data from other sources which is why you have to create the individual class graphs first.
Dave
chewbacca156
Posts: 24
Joined: Tue Apr 04, 2006 7:17 am

Post by chewbacca156 »

There's a unit problem in your template.
You're applying the CDEF "Turn Bytes into Bits", but the units written in the legend is Bytes...
I did not found where to change it...
melchandra
Cacti User
Posts: 311
Joined: Tue Jun 29, 2004 12:52 pm
Location: Indiana

Post by melchandra »

chewbacca156 wrote:There's a unit problem in your template.
You're applying the CDEF "Turn Bytes into Bits", but the units written in the legend is Bytes...
I did not found where to change it...
Sorry for the delayed response, I was at a conference for the last 2 weeks.

The "bytes" on the total summation is a limatation of that special function. You would have to modify the cacti source code to change it. The current/avg/max variables are all in bits, as are the actual graph items (area, stack). I can not change the way the total function works because it is just a comment "total|auto:current:2:auto|"
Dave
zlynt
Posts: 9
Joined: Tue Nov 08, 2005 4:33 pm

Post by zlynt »

Thanks for the templates, works great for us! I can tell it took a long time to create. Did you by chance create a top outbound template?

Z
melchandra
Cacti User
Posts: 311
Joined: Tue Jun 29, 2004 12:52 pm
Location: Indiana

Post by melchandra »

The template is generic. Just drop any class you're already graphing into the template.
Dave
chewbacca156
Posts: 24
Joined: Tue Apr 04, 2006 7:17 am

Post by chewbacca156 »

Hello,

I've a little problem with the units in my classes graphs.
The values and units in the legend are correct, but the values on the graph are not...

See the graph below for example...

Got any idea to correct this ?
Attachments
graph_image.php.png
graph_image.php.png (17.38 KiB) Viewed 19677 times
melchandra
Cacti User
Posts: 311
Joined: Tue Jun 29, 2004 12:52 pm
Location: Indiana

Post by melchandra »

It looks like you've got the CDEF's out of whack. The graph is being converted to bytes - that's why it's 1/8 of the bits being reported in the legend. Look at the template and figure out which CDEF you're using, it shouldn't be converting to bytes.
Dave
chewbacca156
Posts: 24
Joined: Tue Apr 04, 2006 7:17 am

Post by chewbacca156 »

You were right.
The legend had the CDEF "Turn Bytes into Bits", and the graph not.

Thank you ;o)
gjames
Posts: 17
Joined: Fri Aug 24, 2007 1:10 pm

Truncated class names

Post by gjames »

Hi
IO have read this thread but cant figure out hoe to get the proper class names on my graphs.
Where exactly do I make the change in the graph template?

Thanks
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests