summaryrefslogtreecommitdiff
path: root/check_postgres.pl
diff options
context:
space:
mode:
authorGreg Sabino Mullane2013-09-23 19:44:38 +0000
committerGreg Sabino Mullane2013-09-23 19:44:38 +0000
commitf9d17961a54d3867bd9e6253e4b2aef5f0ab566b (patch)
tree72777ecdae907cc00084c872d4111d85360aead0 /check_postgres.pl
parent63689d1bfa670420045e0551a783a58bd6f82ed6 (diff)
Perl::Critic insipred fixes
Diffstat (limited to 'check_postgres.pl')
-rwxr-xr-xcheck_postgres.pl13
1 files changed, 7 insertions, 6 deletions
diff --git a/check_postgres.pl b/check_postgres.pl
index d231c8e39..548a85ae3 100755
--- a/check_postgres.pl
+++ b/check_postgres.pl
@@ -2263,7 +2263,7 @@ sub run_command {
$ENV{PGSERVICE} = $db->{dbservice};
}
else {
- $db->{pname} = "port=" . ($db->{port} || $opt{defaultport}) . " host=$db->{host} db=$db->{dbname} user=$db->{dbuser}";
+ $db->{pname} = 'port=' . ($db->{port} || $opt{defaultport}) . " host=$db->{host} db=$db->{dbname} user=$db->{dbuser}";
}
## If all we want is a connection string, give it and leave now
@@ -4751,7 +4751,7 @@ sub check_hot_standby_delay {
# Check if master is online (e.g. really a master)
for my $x (1..2) {
- my $info = run_command($SQL, { dbnumber => $x, regex => qr(t|f) });
+ my $info = run_command($SQL, { dbnumber => $x, regex => qr([tf]) });
for $db (@{$info->{db}}) {
my $status = $db->{slurp}[0];
@@ -5550,18 +5550,19 @@ sub check_pgagent_jobs {
next;
}
- my ($is_crit, @msg);
+ my ($is_critical, @msg);
my $log_id = -1;
for my $step (@rows) {
my $output = $step->{jsloutput} || '(NO OUTPUT)';
push @msg => "$step->{jslresult} $step->{jobname}/$step->{jstname}: $output";
- $is_crit ||= $step->{critical};
+ $is_critical ||= $step->{critical};
}
(my $msg = join '; ' => @msg) =~ s{\r?\n}{ }g;
- if ($is_crit) {
+ if ($is_critical) {
add_critical $msg;
- } else {
+ }
+ else {
add_warning $msg;
}
}