From 9be7ce345a02d912523c00462f754ab6cc07c46e Mon Sep 17 00:00:00 2001 From: Greg Sabino Mullane Date: Mon, 11 Feb 2013 16:27:40 -0500 Subject: Force slave to be defined, per github issue 19: https://github.com/bucardo/check_postgres/issues/19 --- check_postgres.pl | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'check_postgres.pl') diff --git a/check_postgres.pl b/check_postgres.pl index 9dc3d61a5..041e520ce 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -4754,6 +4754,11 @@ sub check_hot_standby_delay { return; } + ## If no slave detected, assume it is 2 + if (! defined $slave) { + $slave = 2; + } + ## If the slave is "db1" and master "db2", go ahead and switch them around for clearer output if (1 == $slave) { ($slave, $master) = (2, 1); -- cgit v1.2.3