Re: Log file monitoring and event notification - Mailing list pgsql-general

From Steve Crawford
Subject Re: Log file monitoring and event notification
Date
Msg-id 5342DCDB.5050307@pinpointresearch.com
Whole thread Raw
In response to Log file monitoring and event notification  (Andy Colson <andy@squeakycode.net>)
List pgsql-general
On 04/05/2014 08:47 AM, Andy Colson wrote:
> Hi All.
>
> I've started using replication, and I'd like to monitor my logs for
> any errors or problems.  I don't want to do it manually, and I'm not
> interested in stats (a la PgBadger).
>
> What I'd like, is the instant PG logs: "FATAL: wal segment already
> removed" (or some such bad thing), I'd like to get an email....

As one component of our monitoring we route logging through syslog which
has all messages go to one location for use by PgBadger and friends and
simultaneously any message with a WARN or higher priority goes to a
separate temporary "postgresql_trouble.log."

A cron-job checks this file periodically (currently we use 5-minutes)
for content. If the file has content the script sends the appropriate
emails and truncates the trouble log.

Cheers,
Steve



pgsql-general by date:

Previous
From: Hadi Moshayedi
Date:
Subject: Re: Postgres as In-Memory Database?
Next
From: Jeff Janes
Date:
Subject: Re: Initial queries of day slow