From: Greg Sabino Mullane Date: Sat, 12 Feb 2011 04:56:08 +0000 (-0500) Subject: Fix MRTG for last_vacuum and last_analzye X-Git-Tag: 2.18.0~80 X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=d3fe0b3227b007aa00c4e79ca74016dc49e3a637;p=check_postgres.git Fix MRTG for last_vacuum and last_analzye --- diff --git a/check_postgres.pl b/check_postgres.pl index 319dff3d1..f1b66b1e4 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -4092,8 +4092,7 @@ FROM (SELECT nspname, relname, $criteria AS v } } if ($MRTG) { - $stats{$db->{dbname}} = $mintime; - $statsmsg{$db->{dbname}} = msg('vac-msg', $db->{dbname}, $minrel); + do_mrtg({one => $mintime}); return; } if ($maxtime == -2) { diff --git a/t/02_last_vacuum.t b/t/02_last_vacuum.t index f74b6af1e..9266e35ff 100644 --- a/t/02_last_vacuum.t +++ b/t/02_last_vacuum.t @@ -77,11 +77,11 @@ like ($cp->run("-w 0 --exclude=~.* --include=$testtbl"), $t = qq{$S returns correct MRTG information (OK case)}; like ($cp->run("--output=mrtg -w 0 --exclude=~.* --include=$testtbl"), - qr{\d+\n0\n\nDB: $dbname TABLE: public.$testtbl\n}, $t); + qr{\d+\n0\n\n\n}, $t); $t = qq{$S returns correct MRTG information (fail case)}; like ($cp->run('--output=mrtg -w 0 --exclude=~.* --include=no_such_table'), - qr{0\n0\n\nDB: $dbname TABLE: \?\n}, $t); + qr{0\n0\n\n\n}, $t); }