~ubuntu-branches/ubuntu/saucy/munin/saucy

« back to all changes in this revision

Viewing changes to plugins/node.d/postgres_prepared_xacts_.in

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2012-06-11 12:54:28 UTC
  • mfrom: (8.1.30 sid)
  • Revision ID: package-import@ubuntu.com-20120611125428-k8z25s77rp755vxe
Tags: 2.0.0-1ubuntu1
* Resync with Debian unstable.
* d/munin-node.upstart,munin.upstart: Add upstart configurations.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!@@PERL@@
 
2
# -*- cperl -*-
 
3
#
 
4
# Copyright (C) 2010 Magnus Hagander, Redpill Linpro AB
 
5
#
 
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,
 
9
# 1991.
 
10
#
 
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.
 
15
#
 
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
 
19
# 02110-1301 USA.
 
20
 
 
21
=head1 NAME
 
22
 
 
23
postgres_prepared_xacts_ - Plugin to monitor number of prepared
 
24
                           transactions in PostgreSQL.
 
25
 
 
26
=head1 CONFIGURATION
 
27
 
 
28
Configuration is done through libpq environment variables, for example
 
29
PGUSER, PGDATABASE, etc. For more information, see L<Munin::Plugin::Pgsql>.
 
30
 
 
31
To monitor a specific database, link to postgres_size_<databasename>.
 
32
To monitor all databases, link to postgres_size_ALL.
 
33
 
 
34
=head1 SEE ALSO
 
35
 
 
36
L<Munin::Plugin::Pgsql>
 
37
 
 
38
=head1 MAGIC MARKERS
 
39
 
 
40
 #%# family=auto
 
41
 #%# capabilities=autoconf suggest
 
42
 
 
43
=head1 AUTHOR
 
44
 
 
45
Magnus Hagander <magnus@hagander.net>, Redpill Linpro AB
 
46
 
 
47
=head1 COPYRIGHT/License.
 
48
 
 
49
Copyright (c) 2010 Magnus Hagander, Redpill Linpro AB
 
50
 
 
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
 
54
dated June, 1991.
 
55
 
 
56
=cut
 
57
 
 
58
use strict;
 
59
use warnings;
 
60
 
 
61
use Munin::Plugin::Pgsql;
 
62
 
 
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',
 
68
    minversion => '8.1',
 
69
    basequery =>
 
70
        "SELECT database, count(*) FROM pg_prepared_xacts %%FILTER%% GROUP BY database ORDER BY 1",
 
71
    wildcardfilter => "WHERE database=?",
 
72
    configquery =>
 
73
        "SELECT datname,datname FROM pg_database %%FILTER%% ORDER BY 1",
 
74
    suggestquery => "SELECT 'ALL'",
 
75
    autoconfquery =>
 
76
        "SELECT (setting::integer > 0),'Prepared transactions not enabled' FROM pg_settings WHERE name='max_prepared_transactions'",
 
77
    graphdraw => 'AREA',
 
78
    stack     => 1,
 
79
);
 
80
 
 
81
$pg->Process();
 
82
exit(0);
 
83