From 50c98c2da28400d265d97ff2c9df37007128197d Mon Sep 17 00:00:00 2001 From: Zev Benjamin Date: Mon, 26 Aug 2013 15:32:03 -0400 Subject: [PATCH] check_pg_replication_lag: Check for the critical conditions before the warning condition Otherwise critical conditions are only reported as warnings. (imported from commit 3e0e21f952e206e8df5b971633a8b0981540efc7) --- .../files/nagios_plugins/check_pg_replication_lag | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/servers/puppet/modules/zulip/files/nagios_plugins/check_pg_replication_lag b/servers/puppet/modules/zulip/files/nagios_plugins/check_pg_replication_lag index 317ecf7327..8bc1cb8f6a 100755 --- a/servers/puppet/modules/zulip/files/nagios_plugins/check_pg_replication_lag +++ b/servers/puppet/modules/zulip/files/nagios_plugins/check_pg_replication_lag @@ -56,15 +56,9 @@ recv_diff = primary_offset - secondary_recv_offset replay_diff = secondary_recv_offset - secondary_replay_offset # xlog segments are normally 16MB each. These thresholds are pretty arbitrary. -if recv_diff > 16 * 1024**2: - report('WARNING', 'secondary is %d bytes behind on receiving xlog' % (recv_diff,)) - if recv_diff > 5 * 16 * 1024**2: report('CRITICAL', 'secondary is %d bytes behind on receiving xlog' % (recv_diff,)) -if replay_diff > 16 * 1024**2: - report('WARNING', 'secondary is %d bytes behind on applying received xlog' % (replay_diff)) - if replay_diff > 5 * 16 * 1024**2: report('CRITICAL', 'secondary is %d bytes behind on applying received xlog' % (replay_diff)) @@ -74,5 +68,11 @@ if recv_diff < 0: if replay_diff < 0: report('CRITICAL', 'secondary is %d bytes ahead on applying received xlog' % (replay_diff,)) +if recv_diff > 16 * 1024**2: + report('WARNING', 'secondary is %d bytes behind on receiving xlog' % (recv_diff,)) + +if replay_diff > 16 * 1024**2: + report('WARNING', 'secondary is %d bytes behind on applying received xlog' % (replay_diff)) + report('OK', ('secondary is %d bytes behind on receiving and %d bytes behind on applying xlog' % (recv_diff, replay_diff)))