[check_postgres] check_postgres_last_autovacuum

Greg Sabino Mullane greg at endpoint.com
Tue Jul 15 01:14:33 UTC 2008


> I have autovacuum turned on but I get this:
> 
> POSTGRES_LAST_AUTOVACUUM CRITICAL: DB "dbname" (host:192.168.144.103)
> public.people_profile: 11:41 June 04, 2008 (3105742 s) | time=0.04
> public.people_profile=3105742 public.snapboard_category=3104961
...
> public.crime_arrest_charges=18 public.auth_user=18
> 
> I believe tables that never change (no inserts, deletes, or updates) will
> never get autovaccuumed since there is no need.  So is this what is
> happening?  Will this be reported as a warning or critical even if that
> table didn¹t need to be vacuumed?

Upon re-reading this, the answer is yes to both questions. The script can
only know when the last time something was autovacuumed, it has no way of
knowing about why autovacuum may or may not have skipped vacuuming a
each table the last time it ran. In the example above, you would need
to either explicitly include the tables you want to check, or include the
ones you do. You've got a wide range: the people_profile has not been
autovaced in over a month, while auth_user was vacuumed 18 seconds ago.

If you would like the action to do something different, just describe
exactly what you want it to do and we can see about coming up with a new
action, but this is what this one is designed to do, I'm afraid. We could
perhaps come up with an action that asks what the latest time *any*
autovacuum run is (which I think is what Robert's ORDER BY 3 DESC was
alluding to), but I'm not sure I see the usefulness of that, other than a
crude measure of if autovacuum is running or not, of which there may be 
better ways to check.

-- 
Greg Sabino Mullane greg at endpoint.com
End Point Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 163 bytes
Desc: not available
Url : https://mail.endcrypt.com/pipermail/check_postgres/attachments/20080714/5ced1d7e/signature.bin


More information about the Check_postgres mailing list