X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/7b9ec4b60ee39614d1d083d7220e76b07d2b275f..29b8151b8011f934785f3434e3826eee78e61943:/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..56ee16371 100755 --- a/cookbooks/munin/files/default/plugins/postgres_replication +++ b/cookbooks/munin/files/default/plugins/postgres_replication @@ -9,15 +9,11 @@ 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", + graphmin => 0 ); $pg->Process();