Templates to stack up to 32 devices in/out

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

Moderators: Developers, Moderators

Post Reply
sbx
Posts: 16
Joined: Mon Apr 11, 2005 7:59 pm

Templates to stack up to 32 devices in/out

Post by sbx »

Maybe this will be useful to anyone in need to combine up to 32 Sources of IP-Volume. It basically is a Traffic (bits/sec) type of graph template, but for up to 32 sources.

I will include the graph template "IP-Volume up to 32 Sources" , which includes a CDEF called "Combine up to 32 input sources, Turn Bytes into Bits".

In many situations you won't need to stack 32 sources but only 10 oder 20. To be able to use the template anyway, I set up a "Zero Counter". In fact this is fake, as it will count 1 but not zero. Once created you can use the Zero Counter as replacement for any data source missing, that means 22 times or 12 times in the examples above. The Zero Counter template include a data template and the corresponding data input method both called "Zero Counter".

Even considering, that you have 22 or 12 sources, each with value 1, this should not influence the stacked value of your real datasources that much as long as you graph IP volume or anything else with rather high values.

Zero Counter depends on a very basic perl script, that has to be uploaded as "zero.pl" into you scripts directory.

Code: Select all

#!/usr/bin/perl
print 1;
Before importing check if you already have a template with the names mentioned above, as the import process will override existing data as discussed here http://forums.cacti.net/viewtopic.php?t=7176

sbx

---

Attachments deleted. See posting below.
sbx
Last edited by sbx on Fri Apr 15, 2005 6:44 am, edited 1 time in total.
User avatar
Pumpi
Cacti User
Posts: 259
Joined: Wed Jan 14, 2004 3:23 am
Location: Germany

Post by Pumpi »

I think this template is interessting for switch traffic sbx.

Importing cacti_graph_template_ipvolume_up_to_32_sources.xml I get following error:


Cacti has imported the following items:

CDEF
[success] Combine up to 32 output sources, Turn Bytes into Bits [update]
[success] Combine up to 32 input sources, Turn Bytes into Bits [update]

Graph Template
[success] IP-Volume up to 32 Sources [update]
+ Found Dependency: (CDEF) Combine up to 32 input sources, Turn Bytes into Bits
+ Unmet Dependency: (GPRINT Preset) Normal
+ Found Dependency: (CDEF) Combine up to 32 output sources, Turn Bytes into Bits
sbx
Posts: 16
Joined: Mon Apr 11, 2005 7:59 pm

Post by sbx »

Pumpi wrote:I think this template is interessting for switch traffic sbx.
In fact that's what I made it for ;-)
Right now I use it to combine groups of servers as well, like all nameserver, all mailservers, you name it.
Pumpi wrote:Importing cacti_graph_template_ipvolume_up_to_32_sources.xml I get following error:


Cacti has imported the following items:

CDEF
[success] Combine up to 32 output sources, Turn Bytes into Bits [update]
[success] Combine up to 32 input sources, Turn Bytes into Bits [update]

Graph Template
[success] IP-Volume up to 32 Sources [update]
+ Found Dependency: (CDEF) Combine up to 32 input sources, Turn Bytes into Bits
+ Unmet Dependency: (GPRINT Preset) Normal
+ Found Dependency: (CDEF) Combine up to 32 output sources, Turn Bytes into Bits
Right. The "Normal" GPRINT Preset is part of standard cacti distribution. So I removed it from the xml files. I case anyone modified the Normal Preset in his own configuration, his config would be overwritten if I'd have included it. Just in case someone is missing the Normal preset: it's "%8.2lf %s"

sbx
elnino
Cacti User
Posts: 205
Joined: Tue Mar 08, 2005 9:51 pm

Post by elnino »

I must be doing something wrong. I imported the templates ok, except for the error that everyone else got and created zero.pl in the scripts folder. Through devices I clicked "Create graphs for this host" and selected all the ports and then selected the "IP-Volume up to 32 Sources". To get the Zero Counter to show up for my switch, I clicked Data Sources, clicked Add and picked the switch and then the Zero Counter data template.

When the poller ran it said "There are no RRA's assigned to local_data_id: 111" so I went into the data templates and selected all the RRA's for Zero Counter. Now under debug for the graph, it says "ERROR: bad format for [G]PRINT in ' Current:' ". What did I miss?
User avatar
Pumpi
Cacti User
Posts: 259
Joined: Wed Jan 14, 2004 3:23 am
Location: Germany

Post by Pumpi »

Perhaps sbx can provide us with an installation guide :wink:
sbx
Posts: 16
Joined: Mon Apr 11, 2005 7:59 pm

Post by sbx »

Sure. But I guess I have to install a clean cacti on some host to write a full guide. Unfortunately I'm a bit short of time right now. I'll try my best to guide you through it.

I attach both graphs templates including all bells and whistles (CDEFs, RRAs) once again. Maybe it really relies on some dependency. To check the 32-source template you do need to import the 32-template only. On the same host create one standard "Interface - Traffic (bits/sec) " graph. This should be in a working state. After that add the 32-source graph through "Graph Management". The 32-source graph template does not bring any data templates with it and will not create any itself. It needs working datasource you create you create like written above.

Configure it to use the In-Source of your Traffic-Interface for all 32 In-Source and the Out-Source for all 32 Out-Sources. There should be no blank lines anymore (No source set to "None") Doing that should create a working graph 32 times as high as your standard "Interface - Traffic (bits/sec) ".

After that create a Zero-Graph through "New Graphs" (I included the graph template this time as well). You should get a graph with a flat line at 1. Now you can replace some of your 32 In/Out-Sources to the zero source. The 32-graph should still be working. Anything else is just a matter of playing with the sources. Put in all sources you want to combine, fill up the other sources with zeros and you should be done.

sbx
Attachments
cacti_graph_template_zero_counter.xml
(5.67 KiB) Downloaded 528 times
cacti_graph_template_ipvolume_up_to_32_sources.xml
(51.56 KiB) Downloaded 896 times
elnino
Cacti User
Posts: 205
Joined: Tue Mar 08, 2005 9:51 pm

Post by elnino »

Works great now!! I deleted out the other templates and imported the second ones you posted and it worked right away. Thanks again!
User avatar
Pumpi
Cacti User
Posts: 259
Joined: Wed Jan 14, 2004 3:23 am
Location: Germany

Post by Pumpi »

:D Works now - Thanks sbx !
sbx
Posts: 16
Joined: Mon Apr 11, 2005 7:59 pm

Post by sbx »

Glad to help.

Thanks for the feedback. I deleted the initial attachments to avoid confusion.

sbx
elnino
Cacti User
Posts: 205
Joined: Tue Mar 08, 2005 9:51 pm

Post by elnino »

Hi everyone,
I want to expand this template to accept up to 50 sources for a 48 port switch with 2 uplinks. I have added the extra fields in my graph template already, I am just confused on the CDEF and what letters would represent those new fields so I can add them up. I'm also thinking about making a smaller template for smaller switches so I don't have to add as many zero counters. Can anyone give me hand? Thanks
sbx
Posts: 16
Joined: Mon Apr 11, 2005 7:59 pm

Post by sbx »

It's pretty straightforward. Source 1 is "a", source 2 is "b", source 3 is "c" and so on, source 10 is "j". There is no "k", but it starts all over by adding "b", so 11 is "ba", 12 is "bb" again up to 20. For 21 add "c" for "ca", 22 "cb".

a,b,c,d,e,f,g,h,i,j
ba,bb,bc,bd,be,bf,bg,bh,bi,bj
ca,cb,cc,cd,ce,cf,cg,ch,ci,cj
...
...
...
ja,jb,jc,jd,je,jf,jg,jh,ji,jj
(should be last one, never tested. Maybe something like bba,bbc,bbd,... beyond)

That should give to 100 sources in total up to "jj". To combine 2in/2out, you have "a,b,+" and "c,d,+". To combine 3in/3out you have "a,b,c,+,+" and "d,e,f,+,+". You do the math......

Of course this depends on the order of sources. If your template has the following order:

IN (source a)
OUT (source b)
IN (source c)
OUT (source d)

you need "a,c,+" and "b,d,+".

Keep in mind that the field length for CDEF is limited to 150 for custom strings in the mysql table. That's the reason why I have to split my CDEFs in the uploaded example into two rows.


sbx
mmerelles
Posts: 18
Joined: Sat May 21, 2005 11:56 am

ERROR: Could not parse color in ''

Post by mmerelles »

I followed your instructions above, but I receive the following error ERROR: Could not parse color in '' and the graph doesn't appear.

any ideas how to fix this?

NOTE: running cacti 0.8.6.d

thanks
Manuel
mmerelles
Posts: 18
Joined: Sat May 21, 2005 11:56 am

ERROR: Could not parse color in ''

Post by mmerelles »

I fixed the problem going back to rrdtool 1.0.50, it is not working with rrdtool 1.2 for me.
starchywhisper
Posts: 1
Joined: Tue Aug 09, 2005 3:41 am

Post by starchywhisper »

Great Work !!! :P
StarcyWhisper
Julrodrig
Posts: 3
Joined: Fri Mar 24, 2006 4:30 pm
Location: Colombia

ProblemWith template

Post by Julrodrig »

sbx wrote:Sure. But I guess I have to install a clean cacti on some host to write a full guide. Unfortunately I'm a bit short of time right now. I'll try my best to guide you through it.

I attach both graphs templates including all bells and whistles (CDEFs, RRAs) once again. Maybe it really relies on some dependency. To check the 32-source template you do need to import the 32-template only. On the same host create one standard "Interface - Traffic (bits/sec) " graph. This should be in a working state. After that add the 32-source graph through "Graph Management". The 32-source graph template does not bring any data templates with it and will not create any itself. It needs working datasource you create you create like written above.

Configure it to use the In-Source of your Traffic-Interface for all 32 In-Source and the Out-Source for all 32 Out-Sources. There should be no blank lines anymore (No source set to "None") Doing that should create a working graph 32 times as high as your standard "Interface - Traffic (bits/sec) ".

After that create a Zero-Graph through "New Graphs" (I included the graph template this time as well). You should get a graph with a flat line at 1. Now you can replace some of your 32 In/Out-Sources to the zero source. The 32-graph should still be working. Anything else is just a matter of playing with the sources. Put in all sources you want to combine, fill up the other sources with zeros and you should be done.

sbx
Hi i try this but i get error

ERROR: Legend set but no color: Inbound #01

Cacti = Version 0.8.6f
rrdtool = RRDtool 1.2.11
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests