Anybody else having major graph issues?

Post support questions that relate to the Windows 2003/2000/XP operating systems.

Moderators: Developers, Moderators

Post Reply
jblue69
Posts: 2
Joined: Fri Sep 05, 2003 2:08 pm

Anybody else having major graph issues?

Post by jblue69 »

I seem to be having a bunch of problems with graph templates, graph debug, and graphs in general, and I'm wondering if anybody else is experiencing similar problems.

I can generate working graphs by setting up a graph template and then creating the graph and data source using Polling Hosts. The graph debug will work fine (under graph management), and the Graphs tab works fine. If I update the graph template, however, everything breaks (graph tab hangs, graph debug gives errors).

After wandering around through the code and the database, it looks to me like the local graph is losing the data source id after the template updates. The graph debug errors are due to a malformed call to rrdtool (it lacks the DEF entries because of the missing data source), and I can only assume the graph tab hangs are related (although that may be that PHP session issue as well).

Is this ringing any bells for anybody, or is my install just hosed?


Environment is Cacti 0.8.3a, PHP 4.3.3, Win2K server with all patches.
jblue69
Posts: 2
Joined: Fri Sep 05, 2003 2:08 pm

A bug?

Post by jblue69 »

I think I found (and fixed) the problem with the graphing. In the 'push_out_graph_item' function (utility_functions.php, line 537) there's a section at the end that copies the item out to other templates that use the item. Unfortunately, it also overwrites the default 'task_item_id' field in the template which references the actual data source instance. By dropping in a little code to skip the update if it's the 'task_item_id' field, I can now safely make graph template changes without hosing up the graphs I've already built.

Can anyone confirm this to be a bug, or am I missing something about how this works?
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

I think the problem you are describing is why I created "Graph Item Inputs". If you create a graph item input from a field and one or more graph items, they will NOT be overwritten when template changes are made. Instead you must specify their values on a per-graph basis.

This provides the same functionality as the "Use Per-Graph Value" checkboxes, but adds grouping at the same time.

If you have any further questions or need me to clarify, please let me know.

-Ian
Jeppe
Posts: 47
Joined: Sun Feb 09, 2003 4:48 am
Contact:

Post by Jeppe »

This is the exact problem I'm having too. I just changed the Interface - Traffic bits/s graph template a bit. It caused all the 100+ graphs I had to lose their data sources!

If I go over the graphs, changing the data sources back, the graph titles change to wrong ones.

Using cacti083a with linux. Can't reproduce it in a fresh install though. Weird!

Note: Doesn't seem to be in all graph templates. Just tried it and changed a self made graph template. That worked fine and no graphs lost their sources.

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

Post by raX »

Jeppe wrote:This is the exact problem I'm having too. I just changed the Interface - Traffic bits/s graph template a bit. It caused all the 100+ graphs I had to lose their data sources!
If you can only reproduce this problem when upgrading, what version did you upgrade from? I highly doubt this problem is Windows-specific, but you never know. I will try and re-produce this problem the best that I can, I would love to see this resolved.

-Ian
Jeppe
Posts: 47
Joined: Sun Feb 09, 2003 4:48 am
Contact:

Post by Jeppe »

raX wrote: If you can only reproduce this problem when upgrading, what version did you upgrade from? I highly doubt this problem is Windows-specific, but you never know. I will try and re-produce this problem the best that I can, I would love to see this resolved.
I've come all the way up from 0.6.something. I seem to be missing some things that are there if you do a fresh install of 0.8.3a, like those traffic templates which have total traffic.

Too many self made templates and sources etc to do a fresh install...

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

Post by raX »

I think I found the bug and fixed it! The problem occurs when saving a graph item input like you all noticed. This is easy to patch. Open up 'graph_templates.php' in a text editor and scroll down to line 307. Now change the following line:

Code: Select all

db_execute("update graph_templates_item set " . $save["column_name"] . "='$value' where graph_template_id=" . $save["graph_template_id"] . " and local_graph_id>0 and " . array_to_sql_or($selected_graph_items, "local_graph_template_item_id"));
to:

Code: Select all

db_execute("update graph_templates_item set " . $save["column_name"] . "='$value' where local_graph_id=$local_graph_id and " . array_to_sql_or($selected_graph_items, "local_graph_template_item_id"));
Let me know how it works. This fix will not fix any errors that this bug has caused, but it should prevent it from happening any further.

-Ian
freejmx
Posts: 2
Joined: Fri Apr 01, 2011 5:10 am
Location: US
Contact:

buying advertising

Post by freejmx »

Can you sell banner ads here?
If you do, impressions or CPC?
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests