summaryrefslogtreecommitdiff
path: root/check_postgres.pl
diff options
context:
space:
mode:
authorGreg Sabino Mullane2009-08-03 15:48:27 +0000
committerGreg Sabino Mullane2009-08-03 15:48:27 +0000
commitbd82d9f1d1ba81728efb2804fe27003ed4f00022 (patch)
tree9738934f628363760a2fdc211a6eab855a6166b3 /check_postgres.pl
parent7ba6edb208ebd4fa3bb9c38955559d33daebd3d4 (diff)
Proper Nagios perf output for the backends check (Cédric Villemain)
Test adjustments for same (Greg Sabino Mullane)
Diffstat (limited to 'check_postgres.pl')
-rwxr-xr-xcheck_postgres.pl18
1 files changed, 16 insertions, 2 deletions
diff --git a/check_postgres.pl b/check_postgres.pl
index 45f060881..8b40bf844 100755
--- a/check_postgres.pl
+++ b/check_postgres.pl
@@ -2358,7 +2358,21 @@ sub check_backends {
$limit ||= $2;
my ($current,$dbname) = ($1,$3);
## Always want perf to show all
- $db->{perf} .= " '$dbname'=$current";
+ my $nwarn=$w2;
+ my $ncrit=$e2;
+ if ($e1){
+ $ncrit = $limit-$e2;
+ }
+ elsif ($e3) {
+ $ncrit = (int $e2*$limit/100)
+ }
+ if ($w1){
+ $nwarn = $limit-$w2;
+ }
+ elsif ($w3) {
+ $nwarn = (int $w2*$limit/100)
+ }
+ $db->{perf} .= " '$dbname'=$current;$nwarn;$ncrit;0;$limit";
next SLURP if skip_item($dbname);
$total += $current;
}
@@ -7561,7 +7575,7 @@ Items not specifically attributed are by Greg Sabino Mullane.
For same_schema, compare view definitions, and compare languages.
Make script into a global executable via the Makefile.PL file.
Better output when comparing two databases.
- Proper Nagios output syntax for autovac_freeze (Cédric Villemain)
+ Proper Nagios output syntax for autovac_freeze and backends checks (Cédric Villemain)
=item B<Version 2.9.5> (July 24, 2009)