summaryrefslogtreecommitdiffstats
path: root/extensions/Push/bin/nagios_push_checker.pl
diff options
context:
space:
mode:
authorPerl Tidy <perltidy@bugzilla.org>2018-12-05 21:38:52 +0100
committerDylan William Hardison <dylan@hardison.net>2018-12-05 23:49:08 +0100
commit8ec8da0491ad89604700b3e29a227966f6d84ba1 (patch)
tree9d270f173330ca19700e0ba9f2ee931300646de1 /extensions/Push/bin/nagios_push_checker.pl
parenta7bb5a65b71644d9efce5fed783ed545b9336548 (diff)
downloadbugzilla-8ec8da0491ad89604700b3e29a227966f6d84ba1.tar.gz
bugzilla-8ec8da0491ad89604700b3e29a227966f6d84ba1.tar.xz
no bug - reformat all the code using the new perltidy rules
Diffstat (limited to 'extensions/Push/bin/nagios_push_checker.pl')
-rwxr-xr-xextensions/Push/bin/nagios_push_checker.pl33
1 files changed, 17 insertions, 16 deletions
diff --git a/extensions/Push/bin/nagios_push_checker.pl b/extensions/Push/bin/nagios_push_checker.pl
index b578c33d2..4e6e94167 100755
--- a/extensions/Push/bin/nagios_push_checker.pl
+++ b/extensions/Push/bin/nagios_push_checker.pl
@@ -20,15 +20,14 @@ Bugzilla->usage_mode(USAGE_MODE_CMDLINE);
# Number of jobs required in the queue before we alert
-use constant WARN_COUNT => 500;
-use constant ALARM_COUNT => 750;
+use constant WARN_COUNT => 500;
+use constant ALARM_COUNT => 750;
-use constant NAGIOS_OK => 0;
-use constant NAGIOS_WARNING => 1;
-use constant NAGIOS_CRITICAL => 2;
+use constant NAGIOS_OK => 0;
+use constant NAGIOS_WARNING => 1;
+use constant NAGIOS_CRITICAL => 2;
-my $connector = shift
- || die "Syntax: $0 connector\neg. $0 TCL\n";
+my $connector = shift || die "Syntax: $0 connector\neg. $0 TCL\n";
$connector = uc($connector);
my $sql = <<EOF;
@@ -38,15 +37,17 @@ my $sql = <<EOF;
EOF
my $dbh = Bugzilla->switch_to_shadow_db;
-my ($count) = @{ $dbh->selectcol_arrayref($sql, undef, $connector) };
+my ($count) = @{$dbh->selectcol_arrayref($sql, undef, $connector)};
if ($count < WARN_COUNT) {
- print "push $connector OK: $count messages found.\n";
- exit NAGIOS_OK;
-} elsif ($count < ALARM_COUNT) {
- print "push $connector WARNING: $count messages found.\n";
- exit NAGIOS_WARNING;
-} else {
- print "push $connector CRITICAL: $count messages found.\n";
- exit NAGIOS_CRITICAL;
+ print "push $connector OK: $count messages found.\n";
+ exit NAGIOS_OK;
+}
+elsif ($count < ALARM_COUNT) {
+ print "push $connector WARNING: $count messages found.\n";
+ exit NAGIOS_WARNING;
+}
+else {
+ print "push $connector CRITICAL: $count messages found.\n";
+ exit NAGIOS_CRITICAL;
}