Fix bad sort key in check_disk_space.
authorGreg Sabino Mullane <[email protected]>
Mon, 28 Jul 2008 23:37:16 +0000 (19:37 -0400)
committerGreg Sabino Mullane <[email protected]>
Mon, 28 Jul 2008 23:37:16 +0000 (19:37 -0400)
check_postgres.pl

index 55fc0b50d8064a57802b7d1f55fa02753714e0e0..e84aea700ae882901e8de03a63bddda26980b403 100755 (executable)
@@ -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 = $_;