Re: How are ppl monitoring PostgreSQL ... ? What is being

Lists: pgsql-admin
From: "Marc G(dot) Fournier" <scrappy(at)postgresql(dot)org>
To: pgsql-admin(at)postgresql(dot)org
Subject: How are ppl monitoring PostgreSQL ... ? What is being monitored ... ?
Date: 2006-06-10 18:27:17
Message-ID: 20060610152251.M1114@ganymede.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin


The subject kinda says it all ... I know there are SNMP patches available
out there now, but without those ... ?

----
Marc G. Fournier Hub.Org Networking Services (http://www.hub.org)
Email . scrappy(at)hub(dot)org MSN . scrappy(at)hub(dot)org
Yahoo . yscrappy Skype: hub.org ICQ . 7615664


From: Andy Shellam <andy(at)andycc(dot)net>
To: "Marc G(dot) Fournier" <scrappy(at)postgresql(dot)org>, pgsql-admin(at)postgresql(dot)org
Subject: Re: How are ppl monitoring PostgreSQL ... ? What is being
Date: 2006-06-10 18:29:52
Message-ID: 448B0FA0.9050408@andycc.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

I'm using a great little Linux program called "monit" to check that
there's something listening on the 5432 port. It also monitors
individual process memory and CPU usage etc. Quite good.

http://www.tildeslash.com/monit/

Andy

Marc G. Fournier wrote:
>
> The subject kinda says it all ... I know there are SNMP patches
> available out there now, but without those ... ?
>
> ----
> Marc G. Fournier Hub.Org Networking Services (http://www.hub.org)
> Email . scrappy(at)hub(dot)org MSN . scrappy(at)hub(dot)org
> Yahoo . yscrappy Skype: hub.org ICQ . 7615664
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
>
> !DSPAM:14,448b0f39256841201919775!
>
>


From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Andy Shellam <andy(at)andycc(dot)net>
Cc: "Marc G(dot) Fournier" <scrappy(at)postgresql(dot)org>, pgsql-admin(at)postgresql(dot)org
Subject: Re: How are ppl monitoring PostgreSQL ... ? What is being
Date: 2006-06-10 19:06:53
Message-ID: 20060610190652.GA97248@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

On Sat, Jun 10, 2006 at 07:29:52PM +0100, Andy Shellam wrote:
> I'm using a great little Linux program called "monit" to check that
> there's something listening on the 5432 port. It also monitors
> individual process memory and CPU usage etc. Quite good.

A server can be quite broken yet still respond to transport- and
network-layer probes like TCP connections and pings. Some NMSs
support custom monitors, so whenever possible I like to do
application-layer tests to ensure that the server not only accepts
connections but is indeed behaving as expected.

> Marc G. Fournier wrote:
> >
> > The subject kinda says it all ... I know there are SNMP patches
> > available out there now, but without those ... ?

MRTG can generate graphs of anything you can write a script to
measure, as long as the script returns output in a certain format.
Other packages of that ilk probably have similar capabilities.

--
Michael Fuhr


From: Christopher Browne <cbbrowne(at)acm(dot)org>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: How are ppl monitoring PostgreSQL ... ? What is being
Date: 2006-06-10 21:01:28
Message-ID: 87hd2s3etz.fsf@wolfe.cbbrowne.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

mike(at)fuhr(dot)org (Michael Fuhr) wrote:
> On Sat, Jun 10, 2006 at 07:29:52PM +0100, Andy Shellam wrote:
>> I'm using a great little Linux program called "monit" to check that
>> there's something listening on the 5432 port. It also monitors
>> individual process memory and CPU usage etc. Quite good.
>
> A server can be quite broken yet still respond to transport- and
> network-layer probes like TCP connections and pings. Some NMSs
> support custom monitors, so whenever possible I like to do
> application-layer tests to ensure that the server not only accepts
> connections but is indeed behaving as expected.

I'd generally agree with this; it points to having tests that aren't
so much about PostgreSQL as they are about the applications using
PostgreSQL...

>> Marc G. Fournier wrote:
>> >
>> > The subject kinda says it all ... I know there are SNMP patches
>> > available out there now, but without those ... ?
>
> MRTG can generate graphs of anything you can write a script to
> measure, as long as the script returns output in a certain format.
> Other packages of that ilk probably have similar capabilities.

Our NOC group runs "replication tests" against various servers that
feed MRTG; they point at a view that is normally frequently updated,
and check to see how elderly the latest value is.

On replicated nodes, this checks the health of replication.

On "master" nodes, this checks the health of the application itself.
--
select 'cbbrowne' || '@' || 'gmail.com';
http://linuxdatabases.info/info/slony.html
Rules of the Evil Overlord #66. "My security keypad will actually be a
fingerprint scanner. Anyone who watches someone press a sequence of
buttons or dusts the pad for fingerprints then subsequently tries to
enter by repeating that sequence will trigger the alarm system."
<http://www.eviloverlord.com/>


From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: "Marc G(dot) Fournier" <scrappy(at)postgresql(dot)org>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: How are ppl monitoring PostgreSQL ... ? What is being
Date: 2006-06-10 22:04:25
Message-ID: 448B41E9.8030609@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

Marc G. Fournier wrote:
>
> The subject kinda says it all ... I know there are SNMP patches
> available out there now, but without those ... ?

We use Nagios to call shell scripts that perform specific requests to a
PostgreSQL server. Usually over SSH via psql, but you could use anything.

Joshua D. Drake

>
> ----
> Marc G. Fournier Hub.Org Networking Services (http://www.hub.org)
> Email . scrappy(at)hub(dot)org MSN . scrappy(at)hub(dot)org
> Yahoo . yscrappy Skype: hub.org ICQ . 7615664
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
>

--

=== The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive PostgreSQL solutions since 1997
http://www.commandprompt.com/


From: "Marc G(dot) Fournier" <scrappy(at)postgresql(dot)org>
To: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
Cc: "Marc G(dot) Fournier" <scrappy(at)postgresql(dot)org>, pgsql-admin(at)postgresql(dot)org
Subject: Re: How are ppl monitoring PostgreSQL ... ? What is being
Date: 2006-06-11 00:24:26
Message-ID: 20060610211619.K1114@ganymede.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

On Sat, 10 Jun 2006, Joshua D. Drake wrote:

> Marc G. Fournier wrote:
>>
>> The subject kinda says it all ... I know there are SNMP patches available
>> out there now, but without those ... ?
>
> We use Nagios to call shell scripts that perform specific requests to a
> PostgreSQL server. Usually over SSH via psql, but you could use anything.

'k, so what are you testing for? Just that a query runs? time it takes
to run? specific results?

SELECT count(1) FROM pg_connections;

would be a good one to graph ...

----
Marc G. Fournier Hub.Org Networking Services (http://www.hub.org)
Email . scrappy(at)hub(dot)org MSN . scrappy(at)hub(dot)org
Yahoo . yscrappy Skype: hub.org ICQ . 7615664


From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: "Marc G(dot) Fournier" <scrappy(at)postgresql(dot)org>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: How are ppl monitoring PostgreSQL ... ? What is being
Date: 2006-06-11 00:32:08
Message-ID: 448B6488.6060700@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

>
> SELECT count(1) FROM pg_connections;
>
> would be a good one to graph ...

Well you should use pg_stat_databases for that :)

We have complete graphing and monitoring service coming out at the end
of this month.

Joshua D. Drake

>
> ----
> Marc G. Fournier Hub.Org Networking Services (http://www.hub.org)
> Email . scrappy(at)hub(dot)org MSN . scrappy(at)hub(dot)org
> Yahoo . yscrappy Skype: hub.org ICQ . 7615664
>

--

=== The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive PostgreSQL solutions since 1997
http://www.commandprompt.com/


From: "hubert depesz lubaczewski" <depesz(at)gmail(dot)com>
To: "Marc G(dot) Fournier" <scrappy(at)postgresql(dot)org>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: How are ppl monitoring PostgreSQL ... ? What is being monitored ... ?
Date: 2006-06-11 15:10:20
Message-ID: 9e4684ce0606110810n50f8c44cjf02a273a65aac0c2@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

On 6/10/06, Marc G. Fournier <scrappy(at)postgresql(dot)org> wrote:
>
> The subject kinda says it all ... I know there are SNMP patches available
> out there now, but without those ... ?
>

i can tell you what we do monitor:
1. general server things (free disk space, cpu-idle, load, memory used, swap
used, context switches, io operations, sockets in state close_wait).
2. db stuff:
- numer of transactions per second
- database size
- size of specific tables/indices that we know have nasty tendency to grow
- number of objects in database
- duration of longest query
- replication lag (in events, and in time)

to make mrtg graphs of db stuff we made some perl scripts, which are bound
to snmp using snmp's "exec" feature. then we just grab the values using mrtg
and draw. quite simple actually.

depesz

--
http://www.depesz.com/ - nowy, lepszy depesz


From: <ogjunk-pgjedan(at)yahoo(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Cc: hubert depesz lubaczewski <depesz(at)gmail(dot)com>
Subject: Re: How are ppl monitoring PostgreSQL ... ? What is being monitored ... ?
Date: 2006-07-07 04:37:38
Message-ID: 20060707043738.62724.qmail@web50312.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

Interesting, Hubert.
Where/how do you get the data for:
- number of transactions per second
- duration of longest query
?

Thanks,
Otis

----- Original Message ----
From: hubert depesz lubaczewski
To: Marc G. Fournier
Cc: pgsql-admin(at)postgresql(dot)org
Sent: Sunday, June 11, 2006 11:10:20 AM
Subject: Re: [ADMIN] How are ppl monitoring PostgreSQL ... ? What is being monitored ... ?

On 6/10/06, Marc G. Fournier wrote: The subject kinda says it all ... I know there are SNMP patches available
out there now, but without those ... ?


i can tell you what we do monitor:
1. general server things (free disk space, cpu-idle, load, memory used, swap used, context switches, io operations, sockets in state close_wait).
2. db stuff:
- numer of transactions per second
- database size
- size of specific tables/indices that we know have nasty tendency to grow
- number of objects in database
- duration of longest query
- replication lag (in events, and in time)

to make mrtg graphs of db stuff we made some perl scripts, which are bound to snmp using snmp's "exec" feature. then we just grab the values using mrtg and draw. quite simple actually.

depesz

--
http://www.depesz.com/ - nowy, lepszy depesz


From: "hubert depesz lubaczewski" <depesz(at)gmail(dot)com>
To: "ogjunk-pgjedan(at)yahoo(dot)com" <ogjunk-pgjedan(at)yahoo(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: How are ppl monitoring PostgreSQL ... ? What is being monitored ... ?
Date: 2006-07-07 07:37:46
Message-ID: 9e4684ce0607070037g2a66d830sabc77aa2d3116229@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

On 7/7/06, ogjunk-pgjedan(at)yahoo(dot)com <ogjunk-pgjedan(at)yahoo(dot)com> wrote:
>
> Interesting, Hubert.
> Where/how do you get the data for:
> - number of transactions per second

periodically (every 5 minutes) i do:
select sum(xact_commit) + sum(xact_rollback) from pg_stat_database
and then just check against previous value, and calculate "per/second". this
is actually handled nicely by mrtg itself.

- duration of longest query
>

select * from pg_stat_activity where current_query !~ '<IDLE>' order by
query_start asc limit 1;
this has some problems though, but are more or less easily avoidable.

depesz

--
http://www.depesz.com/ - nowy, lepszy depesz


From: Jeff Frost <jeff(at)frostconsultingllc(dot)com>
To: hubert depesz lubaczewski <depesz(at)gmail(dot)com>
Cc: "ogjunk-pgjedan(at)yahoo(dot)com" <ogjunk-pgjedan(at)yahoo(dot)com>, pgsql-admin(at)postgresql(dot)org
Subject: Re: How are ppl monitoring PostgreSQL ... ? What is being
Date: 2006-07-09 20:32:47
Message-ID: Pine.LNX.4.64.0607091330560.31603@discord.home.frostconsultingllc.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

On Fri, 7 Jul 2006, hubert depesz lubaczewski wrote:

> periodically (every 5 minutes) i do:
> select sum(xact_commit) + sum(xact_rollback) from pg_stat_database
> and then just check against previous value, and calculate "per/second". this
> is actually handled nicely by mrtg itself.

Hubert,

Do you already have a MRTG plugin for postgres that you've written and if so,
care to share it with the rest of us? Or better yet, share it with the
mrtg.org folks? I was thinking of writing one, but if you have one already, I
hate to reinvent the wheel.

--
Jeff Frost, Owner <jeff(at)frostconsultingllc(dot)com>
Frost Consulting, LLC http://www.frostconsultingllc.com/
Phone: 650-780-7908 FAX: 650-649-1954


From: "hubert depesz lubaczewski" <depesz(at)gmail(dot)com>
To: "Jeff Frost" <jeff(at)frostconsultingllc(dot)com>
Cc: "ogjunk-pgjedan(at)yahoo(dot)com" <ogjunk-pgjedan(at)yahoo(dot)com>, pgsql-admin(at)postgresql(dot)org
Subject: Re: How are ppl monitoring PostgreSQL ... ? What is being monitored ... ?
Date: 2006-07-10 07:54:20
Message-ID: 9e4684ce0607100054q6e149fddk80bb9a8827e2cf5@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

On 7/9/06, Jeff Frost <jeff(at)frostconsultingllc(dot)com> wrote:
>
> Do you already have a MRTG plugin for postgres that you've written and if
> so,
> care to share it with the rest of us? Or better yet, share it with the
> mrtg.org folks? I was thinking of writing one, but if you have one
> already, I
> hate to reinvent the wheel.
>

this is not mrtg plugin. i use snmpd (net-snmpd to be exact), and connect
custom scripts to it using "exec" directive in config.
so basically i have series of scripts which all look more or less like this:
#!/bin/bash
psql -U pgdba -d some_database -qAt 'select .....';

and a series of:
Exec some-name /etc/snmpd/addons/somescript.sh

that's all.

depesz

--
http://www.depesz.com/ - nowy, lepszy depesz