From: Greg Sabino Mullane <greg@endpoint.com>
Date: Mon, 28 Jul 2008 23:37:16 +0000 (-0400)
Subject: Fix bad sort key in check_disk_space.
X-Git-Tag: 2.9.0~276
X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=40c7d713d07ac450e17959aa74d7232beaff2148;p=check_postgres.git

Fix bad sort key in check_disk_space.
---

diff --git a/check_postgres.pl b/check_postgres.pl
index 55fc0b50d..e84aea700 100755
--- a/check_postgres.pl
+++ b/check_postgres.pl
@@ -1986,7 +1986,7 @@ sub check_disk_space {
 			: $opt{mrtg} eq 'avail'   ? 2
 			: $opt{mrtg} eq 'percent' ? 3 : 2 : 2;
 		my ($one,$two,$msg) = ('','','');
-		for (sort { $b->[$sortby] <=> $a->[$sortby] } keys %stats) {
+		for (sort { $stats{$b}->[$sortby] <=> $stats{$a}->[$sortby] } keys %stats) {
 			if ($one eq '') {
 				$one = $stats{$_}->[$sortby];
 				$msg = $_;