Multiple data sources in a graph using a custom templaplate

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

Moderators: Developers, Moderators

Post Reply
kessen
Posts: 4
Joined: Thu Nov 06, 2008 6:05 am
Contact:

Multiple data sources in a graph using a custom templaplate

Post by kessen »

Hi,

I've encountered a strange behavoiur in Cacti which I personally don't understand. I've tried to figure out if someone had the same problem. Since I wasn't able to find a posting to my specific problem please excuse me if there is a howto or solution which I've overlooked.

The scenario:
I've got 2 Switches which have WAN-Lines connected to them. I'm trying to get a consolidated WAN-Traffic graph by summing all the traffic up whilst keeping the inbound traffic apart from the outbound traffic.

here's what I did:
1st: I've made sure the data sources of the four interfaces existed and the graphing is working.

2st: I created a cdef "sumof4" to summerize 4 values: stating

Code: Select all

cdef=a,b,+,c,+,d,+
3rd:
I created a Graph template called "4-InterfacesSummiert - Traffic (bytes/sec)" by duplicating the existing "Interface - Traffic (bytes/sec)" template. I then edited my Version of the template by changing all the Template Items vom cdef-type "NONE" to my newly created "sumof4".
Since the "Graph Item Input Section" just consisted of two datasources called:

Code: Select all

Inbound Data Source 
Outbound Data Source
I edited The Section to read:

Code: Select all

1st Inbound Data Source   	
1st Outbound Data Source 	
2nd Inbound Data Source 	
2nd Outbound Data Source 
3rd Inbound Data Source 	
3rd Outbound Data Source 	
4th Inbound Data Source 
4th Outbound Data Source
I've made sure that the Inbound Souces are connected to the Inbound Items. (Same for "outbound").
I saved the template and considered it ready to use.

4th:
I've created a new graph using the previously (3rd step) created template. In the "Supplemental Graph Template Data" Section I see my Graph Item Fields that read "1st Outbound Data Source" etc. ... followed by a dropdown menu containing a list of all my Datasources. I Select the appropriate interfaces and directions (inbound / outbound) and after saving everything the thing goes terribly wrong:
looking at the 8 dropdown menus only the last two are taken into account and copied in the previous positions eg:
my choice is:

Code: Select all

1st Inbound Data Source      Switch1-Interface1-Inbound
1st Outbound Data Source 	  Switch1-Interface1-Outbound
2nd Inbound Data Source 	  Switch1-Interface2-Inbound 
2nd Outbound Data Source   Switch1-Interface2-Outbound
3rd Inbound Data Source 	  Switch2-Interface1-Inbound
3rd Outbound Data Source 	  Switch2-Interface1-Outbound
4th Inbound Data Source      Switch2-Interface2-Inbound
4th Outbound Data Source    Switch2-Interface2-Outbound
the following is saved:

Code: Select all

1st Inbound Data Source      Switch2-Interface2-Inbound
1st Outbound Data Source 	  Switch2-Interface2-Outbound
2nd Inbound Data Source 	  Switch2-Interface2-Inbound
2nd Outbound Data Source   Switch2-Interface2-Outbound
3rd Inbound Data Source 	  Switch2-Interface2-Inbound
3rd Outbound Data Source 	  Switch2-Interface2-Outbound
4th Inbound Data Source      Switch2-Interface2-Inbound
4th Outbound Data Source    Switch2-Interface2-Outbound
That's why I think either I've been making massive mistakes or there is a huge bug :-/ ...
I've been using Cacti 0.8.6j but since I consider it to be a bug I've upgraded to 0.8.7b yesterday - the behaviour didn't change.

Perhaps somebody has an idea or can give me a hint

cheers
Andreas
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Sorry that I do not answer directly to your errors.
Please use the pseudo CDEF variable TOTAL_ALL_DATA_SOURCES_NODUPS or TOTAL_SIMILAR_DATA_SOURCES_NODUPS.
They were just amde for adding everything in there (either all interfaces or "all of the same kind", e.g. INPUT)
Reinhard
kessen
Posts: 4
Joined: Thu Nov 06, 2008 6:05 am
Contact:

Post by kessen »

Hi gandalf,
hallo Reinhard :-)

thanks for answering and sorry I didn't mention it: I've tried to change the CDEF to TOTAL_ALL_DATA_SOURCES_NODUPS prior to my mailing. Just to make sure I've checked again. I've tried to set it up as a "Special Data Source" as well as a "Custom String". The behavior stayed the same.
I still have no clue ...

thanks und Danke
Andreas
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Try attached docs, please
Reinhard
Attachments
CDEF.pdf
CDEF examples
(99.17 KiB) Downloaded 496 times
kessen
Posts: 4
Joined: Thu Nov 06, 2008 6:05 am
Contact:

Post by kessen »

Thank your for telling me to read the manual :-? quite a good idea. In fact it is so good I had it myself weeks ago ;-)

the question still remains:
Why are my Selections in the "Supplemental Graph Template Data" ignored and six of eight selected data sources are overwritten by the last two data sources ?

To hint me off to read another manual is not very helpful.
This is neither my first cdef nor my first graph with cacti but the first unexpected behavior in Cacti I've encountered.

Is the number of data sources perhaps limited to the number of graphs in the template ? The "new" thing in my graph is that I do not want the single graphs to be displayed but only the sum - therefor I've only one Graph of a cdef , but 4 Datasources. In the example in the FINE manual the multiple graphs are plotted supplemented by an additional graph of "the sum".
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

kessen wrote:Thank your for telling me to read the manual :-? quite a good idea. In fact it is so good I had it myself weeks ago ;-)
Sorry, but
- this doc is not yet part of cacti manual but wil lbe published with 087c
- your, ähem, post count is not suggesting that this bit is totally clear to you, even if your first post is well phrased
Is the number of data sources perhaps limited to the number of graphs in the template ? The "new" thing in my graph is that I do not want the single graphs to be displayed but only the sum - therefor I've only one Graph of a cdef , but 4 Datasources. In the example in the FINE manual the multiple graphs are plotted supplemented by an additional graph of "the sum".
There's definitively no known maximum to the number of ds's. The limit that comes close is a command line length limit of 2/4k (OS dependant).
So please post the whole rrdtool graph from graph management in DEBUG mode

Reinhard
kessen
Posts: 4
Joined: Thu Nov 06, 2008 6:05 am
Contact:

Post by kessen »

Hello again,

I had a closer look at the connections using phpmysql and I finally realized that the connections in the graph management are just fine. The irritating thing is that when I reenter the dialoque in graphmanagement page all my Scrolldown menus in "Supplemental Graph Template Data" Section show the same selection which made me think it's all messed up.

Truth is the rrds look fine and the graph output is ok as well.

The bug remains in the display of the "Supplemental Graph Template Data".

cheers
Andreas
victorbw
Posts: 1
Joined: Mon Nov 03, 2008 9:54 am

is that the problem u have?

Post by victorbw »

well, im not a pro with cacti. but i hope someone can explain it to me like a mother tells her 5 year old son not to play with fire. and please, dont code anything for me. it annoys me anyway ^^

**edit: i forgot to tell you my problem... sorry bout that. as shown in the picture below, there are to much datasources there. and as usual, i was searchin for topics that might have the same problem, so i can avoid double-topics 8)

if anyone can give me a hint, id probably be a lucky man (if it works).

and at last: a big thx to the devs for their great job!
Attachments
cacti_error.JPG
cacti_error.JPG (161.73 KiB) Viewed 4958 times
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

What do you mean by "too much"? It seems, that you created 4 graphs using a ping script. This will create 4 sets of data sources. Well, this is not optimal, but it is no bug.
Or did I miss your topic?
Reinhard
Shan
Posts: 1
Joined: Tue Mar 17, 2009 1:07 am
Location: Finland, Vantaa
Contact:

Post by Shan »

kessen wrote: I had a closer look at the connections using phpmysql and I finally realized that the connections in the graph management are just fine. The irritating thing is that when I reenter the dialoque in graphmanagement page all my Scrolldown menus in "Supplemental Graph Template Data" Section show the same selection which made me think it's all messed up.

Truth is the rrds look fine and the graph output is ok as well.

The bug remains in the display of the "Supplemental Graph Template Data".
I have exactly same problem, and I hoped that newest cacti would have been fixed that. Now I'm running "Version 0.8.7d".
In my case I have 20 computers and I try to build compined load from the 1minute averages from these machines. When I did "save", it worked (if there were less than 13 computers). But when I came back to this screen this section showed the last added computer in all of these fields (eventhou in debug mode computers were correct). After this I tried to just add all of the computers but it added last computer in the list to all of those.

So long story short ;)... in debug mode I see. this, which is correct.
DEF:a="/var/www/cacti/rra/com-01_load_1min_3210.rrd":load_1min:LAST \
DEF:b="/var/www/cacti/rra/com-02_load_1min_3076.rrd":load_1min:LAST \
DEF:c="/var/www/cacti/rra/com-03_load_1min_3101.rrd":load_1min:LAST \
DEF:d="/var/www/cacti/rra/com-04_load_1min_3126.rrd":load_1min:LAST \
DEF:e="/var/www/cacti/rra/com-05_load_1min_3151.rrd":load_1min:LAST \
DEF:f="/var/www/cacti/rra/com-06_load_1min_3185.rrd":load_1min:LAST \
DEF:g="/var/www/cacti/rra/com-07_load_1min_3770.rrd":load_1min:LAST \
DEF:h="/var/www/cacti/rra/com-08_load_1min_3750.rrd":load_1min:LAST \
DEF:i="/var/www/cacti/rra/com-09_load_1min_3730.rrd":load_1min:LAST \
DEF:j="/var/www/cacti/rra/com-10_load_1min_3710.rrd":load_1min:LAST \
DEF:ba="/var/www/cacti/rra/com-11_load_1min_3690.rrd":load_1min:LAST \
DEF:bb="/var/www/cacti/rra/com-12_load_1min_3670.rrd":load_1min:LAST \
DEF:bc="/var/www/cacti/rra/com-13_load_1min_3650.rrd":load_1min:LAST \
-----------------------------------------------
But in the screen in select boxes I see just com-13 in all of these fields. And If I try to add one section more here, com-14. It will save com-14 to all, (even thou I correct these dropdown to correct computers com01-com-14)

I havent managed to figure out way to round this problem.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests