diff options
Diffstat (limited to 'extensions/Push/bin')
-rwxr-xr-x | extensions/Push/bin/bugzilla-pushd.pl | 4 | ||||
-rwxr-xr-x | extensions/Push/bin/nagios_push_checker.pl | 33 |
2 files changed, 19 insertions, 18 deletions
diff --git a/extensions/Push/bin/bugzilla-pushd.pl b/extensions/Push/bin/bugzilla-pushd.pl index 47c905558..cc509aa45 100755 --- a/extensions/Push/bin/bugzilla-pushd.pl +++ b/extensions/Push/bin/bugzilla-pushd.pl @@ -14,8 +14,8 @@ use 5.10.1; use lib qw(. lib local/lib/perl5); BEGIN { - use Bugzilla; - Bugzilla->extensions; + use Bugzilla; + Bugzilla->extensions; } use Bugzilla::Extension::Push::Daemon; 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; } |