summaryrefslogtreecommitdiff
path: root/check_postgres.pl
diff options
context:
space:
mode:
authorGreg Sabino Mullane2009-04-21 14:31:51 +0000
committerGreg Sabino Mullane2009-04-21 14:31:51 +0000
commit415a650a7fb7c3a16998ee5fd8c9ba1c6026e192 (patch)
treeecab9e0b69a4018e6d9ad9e36df190c79fcdc3d2 /check_postgres.pl
parentb11d503bc3c9b1128203bc6e341a5dd8e724bb8f (diff)
Adjust last_vacuum_analyze a bit.
Diffstat (limited to 'check_postgres.pl')
-rwxr-xr-xcheck_postgres.pl14
1 files changed, 11 insertions, 3 deletions
diff --git a/check_postgres.pl b/check_postgres.pl
index 7525738a0..7e340468c 100755
--- a/check_postgres.pl
+++ b/check_postgres.pl
@@ -3077,13 +3077,20 @@ sub check_last_vacuum_analyze {
next;
}
- my $maxtime = -2;
+ ## -1 means no tables found at all
+ ## -2 means exclusion rules took effect
+ ## -3 means no tables were ever vacuumed/analyzed
+ my $maxtime = -1;
my $maxptime = '?';
my ($minrel,$maxrel) = ('?','?'); ## no critic
my $mintime = 0; ## used for MRTG only
SLURP: while ($db->{slurp} =~ /(\S+)\s+\| (\S+)\s+\|\s+(\-?\d+) \| (.+)\s*$/gm) {
my ($schema,$name,$time,$ptime) = ($1,$2,$3,$4);
- next SLURP if skip_item($name, $schema);
+ $maxtime = -3 if $maxtime == -1;
+ if (skip_item($name, $schema)) {
+ $maxtime = -2 if $maxtime < 1;
+ next SLURP;
+ }
$db->{perf} .= " $schema.$name=$time" if $time >= 0;
if ($time > $maxtime) {
$maxtime = $time;
@@ -3100,10 +3107,11 @@ sub check_last_vacuum_analyze {
$statsmsg{$db->{dbname}} = msg('vac-msg', $db->{dbname}, $minrel);
next;
}
+
if ($maxtime == -2) {
add_unknown msg('no-match-table');
}
- elsif ($maxtime == -1) {
+ elsif ($maxtime < 0) {
add_unknown $type eq 'vacuum' ? msg('vac-nomatch-v') : msg('vac-nomatch-a');
}
else {