pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tony Wasson <ajwasson@gmail.com>
To: pgsql-performance@postgresql.org
Subject: postgresql transaction id monitoring with nagios
Date: Tue, 2 May 2006 11:26:04 -0700
Message-ID: <6d8daee30605021126o7b44e255q552dcdc676c565bf@mail.gmail.com> (raw)

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

Attachments:

  check_pg_transactionids.pl (application/x-perl, 1.7K) download

view thread (10+ messages)  latest in thread

Message-ID: <6d8daee30605021126o7b44e255q552dcdc676c565bf@mail.gmail.com>
Permalink:  ../6d8daee30605021126o7b44e255q552dcdc676c565bf@mail.gmail.com/
Also on:    postgresql.org/message-id/6d8daee30605021126o7b44e255q552dcdc676c565bf@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: ajwasson@gmail.com
  Subject: Re: postgresql transaction id monitoring with nagios
  In-Reply-To: <6d8daee30605021126o7b44e255q552dcdc676c565bf@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox