diff options
author | Greg Sabino Mullane | 2008-10-26 02:53:35 +0000 |
---|---|---|
committer | Greg Sabino Mullane | 2008-10-26 02:53:35 +0000 |
commit | 4a1fe20be58bc91e71805323855087fbd5525b20 (patch) | |
tree | 6eb348c4840f67fa9b17e80cf5f411b086726882 /check_postgres.pl | |
parent | 9651668919c50c84d251f33705c01c40f7639d14 (diff) |
Show percentage on backends.
Diffstat (limited to 'check_postgres.pl')
-rwxr-xr-x | check_postgres.pl | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/check_postgres.pl b/check_postgres.pl index 023d4ec87..ada6d3250 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -1635,7 +1635,8 @@ sub check_backends { if ($MRTG) { do_mrtg({one => 1, msg => "DB=$db->{dbname} Max connections=$limit"}); } - add_ok qq{1 of $limit connections}; + my $percent = (int 1/$limit*100) || 1; + add_ok qq{1 of $limit connections ($percent%)}; return; } @@ -1658,7 +1659,8 @@ sub check_backends { add_unknown 'T-EXCLUDE-DB'; next; } - my $msg = qq{$total of $limit connections}; + my $percent = (int $total / $limit*100) || 1; + my $msg = qq{$total of $limit connections ($percent%)}; my $ok = 1; if ($e1) { ## minus $ok = 0 if $limit-$total >= $e2; @@ -4819,6 +4821,7 @@ Items not specifically attributed are by Greg Sabino Mullane. =item B<Version 2.3.11> Pretty up the time output for last vacuum and analyze actions. + Show the percentage of backends on the check_backends action. =item B<Version 2.3.10> |