diff options
author | Greg Sabino Mullane | 2013-02-11 21:27:40 +0000 |
---|---|---|
committer | Greg Sabino Mullane | 2013-02-11 21:27:40 +0000 |
commit | 9be7ce345a02d912523c00462f754ab6cc07c46e (patch) | |
tree | 3288b41a2306a4804f6fa09acd4110ea340aebc9 /check_postgres.pl | |
parent | 89ab821b98a94fefddd56cbb4bb9d0f961908bd0 (diff) |
Force slave to be defined, per github issue 19: https://github.com/bucardo/check_postgres/issues/19
Diffstat (limited to 'check_postgres.pl')
-rwxr-xr-x | check_postgres.pl | 5 |
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); |