|
|
| Author |
Message |
knitterb
Joined: 27 Jan 2005 Posts: 24
|
Posted: Fri May 13, 2005 10:55 pm Post subject: Graph Templates No Longer Shared? |
|
|
It used to be that when you changed a graph template, any graph that was based upon that template would see the affects. If that no longer supported? A bug? Or perhaps a misconfiguration?
I wanted to change the label on a graph of a GPRINT item, and after making the change, none of my graphs had this change. I had to delete them and recreate them, losing all of my data sources since it doesn't appear that I can apply a graph template to an existing data source.
Am I missing something fundamental? Do I just need to dig deeper and find my issues with the graph template changes not being global?
Thanks,
bk
|
|
| Back to top |
|
 |
knitterb
Joined: 27 Jan 2005 Posts: 24
|
Posted: Fri May 13, 2005 11:45 pm Post subject: Example of some more template data items coming over |
|
|
Here is an example of a diff against CVS HEAD that I'm talking about. Hopefully this will make it clear what I'm asking about! Applying this would allow for things like LINE style changes, colors, ordering and stuff.
diff -c -r1.123 rrd.php
*** lib/rrd.php 9 May 2005 02:47:32 -0000 1.123
--- lib/rrd.php 14 May 2005 04:44:16 -0000
***************
*** 498,520 ****
/* lets make that sql query... */
$graph_items = db_fetch_assoc("select
graph_item.id,
! graph_item.cdef,
! graph_item.legend_format,
! graph_item.legend_value,
! graph_item.hard_return,
! graph_item.consolidation_function,
! graph_item.graph_item_type,
! graph_item.gprint_format,
! graph_item.color,
graph_item.data_source_item_id,
data_source_item.data_source_id,
data_source_item.rrd_minimum,
data_source_item.rrd_maximum,
data_source_item.data_source_name
from graph_item
! left join data_source_item on graph_item.data_source_item_id=data_source_item.id
where graph_item.graph_id = $graph_id
! order by graph_item.sequence");
/* +++++++++++++++++++++++ GRAPH OPTIONS +++++++++++++++++++++++ */
--- 498,522 ----
/* lets make that sql query... */
$graph_items = db_fetch_assoc("select
graph_item.id,
! graph_template_item.cdef,
! graph_template_item.legend_format,
! graph_template_item.legend_value,
! graph_template_item.hard_return,
! graph_template_item.consolidation_function,
! graph_template_item.graph_item_type,
! graph_template_item.gprint_format,
! graph_template_item.color,
graph_item.data_source_item_id,
data_source_item.data_source_id,
data_source_item.rrd_minimum,
data_source_item.rrd_maximum,
data_source_item.data_source_name
from graph_item
! left join data_source_item on graph_item.data_source_item_id=data_source_item.id,
! graph_template_item
where graph_item.graph_id = $graph_id
! and graph_item.graph_template_item_id=graph_template_item.id
! order by graph_template_item.sequence");
/* +++++++++++++++++++++++ GRAPH OPTIONS +++++++++++++++++++++++ */
***************
*** 1058,1061 ****
}
}
! ?>
\ No newline at end of file
--- 1060,1063 ----
}
}
! ?>
|
|
| Back to top |
|
 |
knitterb
Joined: 27 Jan 2005 Posts: 24
|
Posted: Fri May 13, 2005 11:46 pm Post subject: Patch |
|
|
Opps
| Description: |
|
 Download |
| Filename: |
templates.patch |
| Filesize: |
1.94 KB |
| Downloaded: |
386 Time(s) |
|
|
| Back to top |
|
 |
raX Lead Developer
Joined: 13 Oct 2001 Posts: 2235 Location: Carlisle, PA
|
Posted: Sat May 14, 2005 8:13 pm Post subject: |
|
|
If changes made to the template are not making their way to the graph, then there is a bug. I have noticed however that you are using the unstable CVS version of Cacti. Keep in mind that numerous template changes are taking place and bugs like this are just a side effect as code is being refactored. This will definitely be fixed ASAP.
Also, the patch you propose here will not do what you intend because of how templates in Cacti work. A templated graph is exactly the same as a non-templated graph, except that a templated graph has a graph template attached to it. This allows you to template only certain fields while others are still specified on a per-graph basis. If you always pulled everything from the graph template itself, you would not have this ability.
-Ian
|
|
| Back to top |
|
 |
knitterb
Joined: 27 Jan 2005 Posts: 24
|
Posted: Sat May 14, 2005 10:54 pm Post subject: |
|
|
| raX wrote: | | I have noticed however that you are using the unstable CVS version of Cacti. |
Yeah, I require the CVS version for SNMP v3 capabilites. Sure it's unstable, but not too unstable for me!
| raX wrote: | | Keep in mind that numerous template changes are taking place and bugs like this are just a side effect as code is being refactored. This will definitely be fixed ASAP. |
Fair enough. I hope this at least helps you out? Let me know if things like this are premature bug filings.
| raX wrote: |
Also, the patch you propose here will not do what you intend because of how templates in Cacti work. A templated graph is exactly the same as a non-templated graph, except that a templated graph has a graph template attached to it. This allows you to template only certain fields while others are still specified on a per-graph basis. If you always pulled everything from the graph template itself, you would not have this ability.
|
Oh yeah! I forgot about the "able to be overridden" thing. Okay, I see why this wouldn't work. Thanks for the explanation.
Let me know if I can help test CVS HEAD with SNMPv3 capabilities in a more effiicient manner. Thanks for the input, and thanks for Cacti!
--
-bk
|
|
| Back to top |
|
 |
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|