]> git.openstreetmap.org Git - chef.git/blob - cookbooks/munin/files/default/plugins/postgres_replication
Force axis to start at zero for postgres replication graphs
[chef.git] / cookbooks / munin / files / default / plugins / postgres_replication
1 #!/usr/bin/perl
2
3 use strict;
4 use warnings;
5
6 use Munin::Plugin::Pgsql;
7
8 my $pg = Munin::Plugin::Pgsql->new(
9     title     => 'PostgreSQL replication delay',
10     info      => 'Replication delay',
11     vlabel    => 'Seconds',
12     basequery => "SELECT (extract(epoch FROM now()) - extract(epoch FROM pg_last_xact_replay_timestamp()))::int AS delay",
13     pivotquery => 1,
14     configquery => "VALUES ('delay','Replication delay')",
15     extraconfig => "delay.warning 300\ndelay.critical 3600",
16     graphmin  => 0
17 );
18
19 $pg->Process();