Re: allow a user to see current_query in pg_stat_activity in 8.4

Поиск
Список
Период
Сортировка
От ynux
Тема Re: allow a user to see current_query in pg_stat_activity in 8.4
Дата
Msg-id 1356095526821-5737499.post@n5.nabble.com
обсуждение исходный текст
Ответ на Re: allow a user to see current_query in pg_stat_activity in 8.4  (Greg Williamson <gwilliamson39@yahoo.com>)
Ответы Re: allow a user to see current_query in pg_stat_activity in 8.4  (Robert Treat <rob@xzilla.net>)
Список pgsql-admin
Hi.
Your question was:

>> We want to create a role used by a monitor to check for "<IDLE> in
>> Transaction" with the most restrictive permissions we can on a 8.4.13
>> instance.
>
>> The user has been granted connect privilege to the database and some
>> limited permissions to user tabhles that need to be monitored. But
>> pg_stat_activity shows only "<insufficient privilege>"
>

I had the same problem, wondered how nagios does it, and found this:
https://github.com/elecnix/nagios-postgresql/blob/master/pg_stat_activity.sql

It works perfectly for me, on 8.4.12 though.
Make sure to run it in the database your monitoring user connects to, and do
not use template1. You may have to "create language plpgsql;" first.

Regards, Ynux



--
View this message in context:
http://postgresql.1045698.n5.nabble.com/allow-a-user-to-see-current-query-in-pg-stat-activity-in-8-4-tp5736517p5737499.html
Sent from the PostgreSQL - admin mailing list archive at Nabble.com.


В списке pgsql-admin по дате отправления:

Предыдущее
От: Gary Stainburn
Дата:
Сообщение: Re: create role?
Следующее
От: Ted Zlatanov
Дата:
Сообщение: CFEngine policies to set up PostgreSQL