Sorting of graphs and columns
Moderators: Developers, Moderators
Newbie question
How can add this patch?
Tnx
Tnx
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
Copy this stuff into a file of your liking
and save it to the main cacti directory. From command line, enter where your.patch is the file you've just created
Reinhard
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>");
Code: Select all
patch -p1 -N < your.patch
Reinhard
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
You are correct.
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?
Still an issue
Updated to cacti 0.8.6j. Graph tree's are "natural sorting".
The graphs and datasources view incorrectly.
List of data sources:
The graphs and datasources view incorrectly.
List of data sources:
- Attachments
-
- Clipboard01.jpg (47.32 KiB) Viewed 4451 times
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
Well, I didn't add it to the Data Source list. I guess I was simply adding to the Tree and Host Graph displays and not either the Data Sources or Graphs from the Console. Hmm. Can you log another feature request in Mantis. (http://bugs.cacti.net). Sorry about that...
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?
10x i'm using .6h with this hack http://forums.cacti.net/viewtopic.php?t ... light=sort
There is no sorting method for a "Host" type (or at least I can't find it), or to do this I would have to add individual graphs.
I currently have:
Default Tree
- Infrastructure (Heading)
- Host: Switch 1 (Graph)
I have tried changing to natural at the Infrastructure level and click on propagate changes, but it did not affect the each host Host graph.
Am I missing something?
-Thomas
I currently have:
Default Tree
- Infrastructure (Heading)
- Host: Switch 1 (Graph)
I have tried changing to natural at the Infrastructure level and click on propagate changes, but it did not affect the each host Host graph.
Am I missing something?
-Thomas
TheWitness wrote: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
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
m4tth3wv,
The picture you post is properly sorted.
TheWitness
The picture you post is properly sorted.
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?
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
Hmm,
Change the display order from Graph Template to Data Query based for this host and see if it works in one version but not in the next. More QA on contributions I am thinking.
TheWitness
Change the display order from Graph Template to Data Query based for this host and see if it works in one version but not in the next. More QA on contributions I am thinking.
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?
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
Zwim,
Can you please add a bug report indicating which host display type is not properly sorting. I don't have the time to research it, and need your feedback. The site is http://bugs.cacti.net
Thanks,
TheWitness
Can you please add a bug report indicating which host display type is not properly sorting. I don't have the time to research it, and need your feedback. The site is http://bugs.cacti.net
Thanks,
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: No registered users and 0 guests