4
# Copyright (C) 2010 Magnus Hagander, Redpill Linpro AB
6
# This program is free software; you can redistribute it and/or
7
# modify it under the terms of the GNU General Public License
8
# as published by the Free Software Foundation; version 2 dated June,
11
# This program is distributed in the hope that it will be useful,
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
# GNU General Public License for more details.
16
# You should have received a copy of the GNU General Public License
17
# along with this program; if not, write to the Free Software
18
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23
postgres_prepared_xacts_ - Plugin to monitor number of prepared
24
transactions in PostgreSQL.
28
Configuration is done through libpq environment variables, for example
29
PGUSER, PGDATABASE, etc. For more information, see L<Munin::Plugin::Pgsql>.
31
To monitor a specific database, link to postgres_size_<databasename>.
32
To monitor all databases, link to postgres_size_ALL.
36
L<Munin::Plugin::Pgsql>
41
#%# capabilities=autoconf suggest
45
Magnus Hagander <magnus@hagander.net>, Redpill Linpro AB
47
=head1 COPYRIGHT/License.
49
Copyright (c) 2010 Magnus Hagander, Redpill Linpro AB
51
All rights reserved. This program is free software; you can
52
redistribute it and/or modify it under the terms of the GNU General
53
Public License as published by the Free Software Foundation; version 2
61
use Munin::Plugin::Pgsql;
63
my $pg = Munin::Plugin::Pgsql->new(
64
basename => 'postgres_prepared_xacts_',
65
title => 'PostgreSQL prepared transactions',
66
info => 'Number of transactions',
67
vlabel => 'Transactions',
70
"SELECT database, count(*) FROM pg_prepared_xacts %%FILTER%% GROUP BY database ORDER BY 1",
71
wildcardfilter => "WHERE database=?",
73
"SELECT datname,datname FROM pg_database %%FILTER%% ORDER BY 1",
74
suggestquery => "SELECT 'ALL'",
76
"SELECT (setting::integer > 0),'Prepared transactions not enabled' FROM pg_settings WHERE name='max_prepared_transactions'",