postgresql transaction id monitoring with nagios

From: "Tony Wasson" <ajwasson(at)gmail(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: postgresql transaction id monitoring with nagios
Date: 2006-05-02 18:26:04
Message-ID: 6d8daee30605021126o7b44e255q552dcdc676c565bf@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Ever since I started working with PostgreSQL I've heard the need to
watch transaction IDs. The phrase "transaction ID wraparound" still
gives me a shiver. Attached it a short script that works with the
monitoring system Nagios to keep an eye on transaction IDs. It should
be easy to adapt to any other monitoring system.

It runs the textbook query below and reports how close you are to wraparound.
SELECT datname, age(datfrozenxid) FROM pg_database;

The script detects a wrap at 2 billion. It starts warning once one or
more databases show an age over 1 billion transactions. It reports
critical at 1.5B transactions. I hope everyone out there is vacuuming
*all* databases often.

Hope some of you can use this script!
Tony Wasson

Attachment Content-Type Size
check_pg_transactionids.pl application/x-perl 1.7 KB

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Brendan Duddridge 2006-05-02 18:40:43 Re: Slow restoration question
Previous Message Jim C. Nasby 2006-05-02 17:16:17 Re: Slow restoration question