diff options
author | Ashish Vijayaram <ashish@mozilla.com> | 2013-12-17 06:25:21 +0100 |
---|---|---|
committer | Byron Jones <bjones@mozilla.com> | 2013-12-17 06:25:21 +0100 |
commit | 210e17650e672e6023f1cafaf5536cd75e2254d4 (patch) | |
tree | 4fafdb7a90c09e68eb3629f796a7c91020c8f4fd /contrib | |
parent | 265ab8e14b94e51a56a1bb16aa536cedbfe56ad6 (diff) | |
download | bugzilla-210e17650e672e6023f1cafaf5536cd75e2254d4.tar.gz bugzilla-210e17650e672e6023f1cafaf5536cd75e2254d4.tar.xz |
Bug 951020: Nagios bug queue checks should also support paging for a specific component
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/nagios_blocker_checker.pl | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/contrib/nagios_blocker_checker.pl b/contrib/nagios_blocker_checker.pl index a67d72b6e..85bcc84de 100755 --- a/contrib/nagios_blocker_checker.pl +++ b/contrib/nagios_blocker_checker.pl @@ -24,9 +24,10 @@ Bugzilla->usage_mode(USAGE_MODE_CMDLINE); my $config = { - # filter by assignee or product + # filter by assignee, product or component assignee => '', product => '', + component => '', unassigned => 'nobody@mozilla.org', # severities severity => 'major,critical,blocker', @@ -42,12 +43,13 @@ my $config = { my $usage = <<EOF; FILTERS - the filter determines which bugs to check, either by assignee or product. - for backward compatibility, if just an email address is provided, it will be - used as the assignee. + the filter determines which bugs to check, either by assignee, product or the + product's component. For backward compatibility, if just an email address is + provided, it will be used as the assignee. --assignee <email> filter bugs by assignee --product <name> filter bugs by product name + --component <name> filter bugs by product's component name --unassigned <email> set the unassigned user (default: $config->{unassigned}) SEVERITIES @@ -78,6 +80,7 @@ EOF die($usage) unless GetOptions( 'assignee=s' => \$config->{assignee}, 'product=s' => \$config->{product}, + 'component=s' => \$config->{component}, 'severity=s' => \$config->{severity}, 'major_alarm=i' => \$config->{major_alarm}, 'major_warn=i' => \$config->{major_warn}, @@ -92,6 +95,7 @@ die $usage if $config->{help} || !($config->{assignee} || $config->{product}) || ($config->{assignee} && $config->{product}) + || ($config->{component} && !$config->{product}) || !$config->{severity}; # @@ -107,6 +111,11 @@ my($where, @values, $severity); if ($config->{assignee}) { $where = 'bugs.assigned_to = ?'; push @values, Bugzilla::User->check({ name => $config->{assignee} })->id; +} elsif ($config->{component}) { + $where = 'bugs.product_id = ? AND bugs.component_id = ? AND bugs.assigned_to = ?'; + push @values, Bugzilla::Product->check({ name => $config->{product} })->id; + push @values, Bugzilla::Component->check({ name => $config->{component} })->id; + push @values, Bugzilla::User->check({ name => $config->{unassigned} })->id; } else { $where = 'bugs.product_id = ? AND bugs.assigned_to = ?'; push @values, Bugzilla::Product->check({ name => $config->{product} })->id; |