summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Sabino Mullane2013-02-11 21:27:40 +0000
committerGreg Sabino Mullane2013-02-11 21:27:40 +0000
commit9be7ce345a02d912523c00462f754ab6cc07c46e (patch)
tree3288b41a2306a4804f6fa09acd4110ea340aebc9
parent89ab821b98a94fefddd56cbb4bb9d0f961908bd0 (diff)
Force slave to be defined, per github issue 19: https://github.com/bucardo/check_postgres/issues/19
-rwxr-xr-xcheck_postgres.pl5
1 files changed, 5 insertions, 0 deletions
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);