X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/7b9ec4b60ee39614d1d083d7220e76b07d2b275f..d118d2178b14eefa5a486e528d730956175fdf40:/cookbooks/munin/files/default/plugins/postgres_replication diff --git a/cookbooks/munin/files/default/plugins/postgres_replication b/cookbooks/munin/files/default/plugins/postgres_replication index a41af7d3b..16d6b51be 100755 --- a/cookbooks/munin/files/default/plugins/postgres_replication +++ b/cookbooks/munin/files/default/plugins/postgres_replication @@ -9,15 +9,10 @@ my $pg = Munin::Plugin::Pgsql->new( title => 'PostgreSQL replication delay', info => 'Replication delay', vlabel => 'Seconds', - basequery => - "SELECT - CASE - WHEN pg_last_xlog_receive_location() = pg_last_xlog_replay_location() THEN 0::int - ELSE (extract(epoch FROM now()) - extract(epoch FROM pg_last_xact_replay_timestamp()))::int - END AS delay", + basequery => "SELECT (extract(epoch FROM now()) - extract(epoch FROM pg_last_xact_replay_timestamp()))::int AS delay", pivotquery => 1, - configquery => - "VALUES ('delay','Replication delay')" + configquery => "VALUES ('delay','Replication delay')", + extraconfig => "delay.warning 300\ndelay.critical 3600" ); $pg->Process();