Sorting of graphs and columns
Moderators: Developers, Moderators
Sorting of graphs and columns
Hi,
Just installed Cacti and after a few problems I managed to resolve using this forum I still have two questions:
- How do I sort graphs differently? Currently Gi0/10 is placed after Gi0/1 instead of Gi0/2 and so on. Also I would like to get the interface descriptions of the cisco switches in the graph.
- Does Cacti contain a setting to place 2 or more graphs next to eachother. At the moment (default) it places all graphs under eachother.
Thanks for creating such a cool product!!
Regards,
Erwin
Just installed Cacti and after a few problems I managed to resolve using this forum I still have two questions:
- How do I sort graphs differently? Currently Gi0/10 is placed after Gi0/1 instead of Gi0/2 and so on. Also I would like to get the interface descriptions of the cisco switches in the graph.
- Does Cacti contain a setting to place 2 or more graphs next to eachother. At the moment (default) it places all graphs under eachother.
Thanks for creating such a cool product!!
Regards,
Erwin
Try this patch against cacti 0.8.6i:
Code: Select all
--- cacti.orig/lib/html_tree.php 2006-10-08 20:06:01.000000000 -0700
+++ cacti/lib/html_tree.php 2006-11-13 17:18:24.000000000 -0800
@@ -457,6 +457,10 @@
return $dhtml_tree;
}
+function nat_sort_graphs($a, $b) {
+ return strnatcasecmp($a['title_cache'], $b['title_cache']);
+}
+
function grow_right_pane_tree($tree_id, $leaf_id, $host_group_data) {
global $current_user, $colors, $config;
@@ -586,6 +590,7 @@
and graph_local.host_id=" . $leaf["host_id"] . "
$sql_where
order by graph_templates_graph.title_cache");
+ usort($graphs, 'nat_sort_graphs');
if (read_graph_config_option("thumbnail_section_tree_2") == "on") {
html_graph_thumbnail_area($graphs, "", "view_type=tree&graph_start=" . get_current_graph_start() . "&graph_end=" . get_current_graph_end(), "<tr bgcolor='#a9b7cb'><td colspa
n='3' class='textHeaderDark'><strong>Graph Template:</strong> " . $graph_template["name"] . "</td></tr>");
- fmangeant
- Cacti Guru User
- Posts: 2345
- Joined: Fri Sep 19, 2003 8:36 am
- Location: Sophia-Antipolis, France
- Contact:
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
It shouldn't make a difference. How do you have your graph tree set up? The patch I made doesn't affect the list in the left column, just the right side where the graphs are actually displayed. I think 0.8.6i added some natural sorting options in other places though. You may want to upgrade.timi wrote:is it a problem if the html_tree.php is not the original one ? i had to modify it for a reason...
aha, i understand ... well i will swhitch to .6i after i'm sure that it is safe toVinceV wrote:It shouldn't make a difference. How do you have your graph tree set up? The patch I made doesn't affect the list in the left column, just the right side where the graphs are actually displayed. I think 0.8.6i added some natural sorting options in other places though. You may want to upgrade.timi wrote:is it a problem if the html_tree.php is not the original one ? i had to modify it for a reason...
- TheWitness
- Developer
- Posts: 17061
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
What happens if you change the sort order in 0.8.6i to Natural? This should have fixed this. No patch should be required.
TheWitness
TheWitness
True understanding begins only when we realize how little we truly understand...
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Who is online
Users browsing this forum: fpiorek and 1 guest