Repository
Munin (master)
Last change
2019-05-22
Family
auto
Capabilities
Language
Perl
License
PostgreSQL

postgres_checksums

Name

postgres_checksum - Plugin to monitor for PostgreSQL checksum failures.

Configuration

Configuration is done through libpq environment variables, for example PGUSER, PGDATABASE, etc. For more information, see Munin::Plugin::Pgsql.

To monitor several instances, link to postgres_<tag>_checksums The <tag> can be what you want but without “_”. It allows you to define several database configuration.

Example : [postgres_pg91_*] env.PGPORT 5432 [postgres_pg92_*] env.PGPORT 5432

See Also

Munin::Plugin::Pgsql

Magic Markers

#%# family=auto
#%# capabilities=autoconf

Copyright/License.

All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 dated June, 1991.

#!/usr/bin/perl
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; version 2 dated June,
# 1991.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301 USA.

=head1 NAME

postgres_checksum - Plugin to monitor for PostgreSQL checksum failures.

=head1 CONFIGURATION

Configuration is done through libpq environment variables, for example
PGUSER, PGDATABASE, etc. For more information, see L<Munin::Plugin::Pgsql>.

To monitor several instances, link to postgres_<tag>_checksums
The <tag> can be what you want but without "_". It allows you to define several
database configuration.

Example :
  [postgres_pg91_*]
  env.PGPORT 5432
  [postgres_pg92_*]
  env.PGPORT 5432

=head1 SEE ALSO

L<Munin::Plugin::Pgsql>

=head1 MAGIC MARKERS

 #%# family=auto
 #%# capabilities=autoconf

=head1 COPYRIGHT/License.

All rights reserved. This program is free software; you can
redistribute it and/or modify it under the terms of the GNU General
Public License as published by the Free Software Foundation; version 2
dated June, 1991.

=cut

use strict;
use warnings;

use Munin::Plugin::Pgsql;

my $pg = Munin::Plugin::Pgsql->new(
    title  => 'PostgreSQL checksum failures',
    info   => 'Data checksum failures per database',
    vlabel => 'Checksum failures',
    minversion => '12',
    basequery =>
        "SELECT '_'||coalesce(datname,''),checksum_failures FROM pg_stat_database ORDER BY 1",
    configquery =>
        "SELECT '_'||coalesce(datname,''),coalesce(datname,'Global') FROM pg_stat_database ORDER BY 1",
    autoconfquery =>
        "SELECT setting::bool,'Data checksums are not enabled' FROM pg_settings WHERE name='data_checksums'",
    graphtype => 'DERIVE',
    graphmin  => 0,
    critical  => '0:0',
);

$pg->Process();