Dear all:
The attached patch adds a new option for the grid "Sorted" menu called
"by down host" which will sort the list of data_sources/cluster by the
number of hosts down (sources with most downed hosts are on top).
I will check this into SVN trunk after folks had a chance to review.
Comments are welcome.
Thanks,
Bernard
On 3/16/07, Bernard Li <[EMAIL PROTECTED]> wrote:
Hi guys:
Currently if you have a grid with many different sources, it is not
immediately obvious which data_source has hosts that are down (the
summary section tells you there are n nodes down, but you have to
scroll through the entire page to find which data_source has nodes
that are down).
Would it be helpful to have a new sort order that lets you sort by
host down (obviously the data_source that has downed nodes will show
up first?)
Cheers,
Bernard
Index: web/meta_view.php
===================================================================
--- web/meta_view.php (revision 756)
+++ web/meta_view.php (working copy)
@@ -43,11 +43,16 @@
}
else if ($sort == "by hostname") {
ksort($sorted_sources);
-}
-else {
+} else if ($sort == "by down host") {
+ foreach ($sorted_sources as $source => $val) {
+ $sorted_sources[$source] = intval($grid[$source]['HOSTS_DOWN']);
+ }
+ arsort($sorted_sources);
+} else {
asort($sorted_sources);
}
+
# Display the sources. The first is ourself, the rest are our children.
foreach ( $sorted_sources as $source => $val )
{
Index: web/header.php
===================================================================
--- web/header.php (revision 756)
+++ web/header.php (working copy)
@@ -294,6 +294,7 @@
$context_sorts[]="ascending";
$context_sorts[]="descending";
$context_sorts[]="by hostname";
+ $context_sorts[]="by down host";
$sort_menu = "<B>Sorted</B> "
."<SELECT NAME=\"s\" OnChange=\"ganglia_form.submit();\">\n";