Re: Log file monitoring and event notification

From: Steve Crawford <scrawford(at)pinpointresearch(dot)com>
To: Andy Colson <andy(at)squeakycode(dot)net>, PostgreSQL general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Log file monitoring and event notification
Date: 2014-04-07 17:14:03
Message-ID: 5342DCDB.5050307@pinpointresearch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Janes 2014-04-07 20:13:50 Re: Initial queries of day slow
Previous Message Hadi Moshayedi 2014-04-07 15:40:50 Re: Postgres as In-Memory Database?