[Bps-public-commit] RT-Extension-Nagios branch, master, updated. 3b0fe1ce02c1e1bb88c065f6aba168f66ab56c67
sunnavy at bestpractical.com
sunnavy at bestpractical.com
Mon Sep 28 02:10:44 EDT 2009
The branch, master has been updated
via 3b0fe1ce02c1e1bb88c065f6aba168f66ab56c67 (commit)
from c87f861beb8a6c1172ac5eee78bce99d6dccd8a7 (commit)
Summary of changes:
lib/RT/Action/Nagios.pm | 3 ++-
lib/RT/Extension/Nagios.pm | 16 +++++++++++-----
2 files changed, 13 insertions(+), 6 deletions(-)
- Log -----------------------------------------------------------------
commit 3b0fe1ce02c1e1bb88c065f6aba168f66ab56c67
Author: sunnavy <sunnavy at bestpractical.com>
Date: Mon Sep 28 14:10:38 2009 +0800
add NagiosSearchAllQueues config
diff --git a/lib/RT/Action/Nagios.pm b/lib/RT/Action/Nagios.pm
index 0df67ea..60b2a54 100644
--- a/lib/RT/Action/Nagios.pm
+++ b/lib/RT/Action/Nagios.pm
@@ -34,7 +34,8 @@ sub Commit {
subject with values $type, $category, $host, $problem_type and $problem_severity"
);
my $tickets = RT::Tickets->new( $self->CurrentUser );
- $tickets->LimitQueue( VALUE => $new_ticket->Queue );
+ $tickets->LimitQueue( VALUE => $new_ticket->Queue )
+ unless RT->Config->Get('NagiosSearchAllQueues');
$tickets->LimitSubject(
VALUE => "$category Alert: $host/$problem_type",
OPERATOR => 'LIKE',
diff --git a/lib/RT/Extension/Nagios.pm b/lib/RT/Extension/Nagios.pm
index 40e5bdf..d93ce33 100644
--- a/lib/RT/Extension/Nagios.pm
+++ b/lib/RT/Extension/Nagios.pm
@@ -28,7 +28,7 @@ extension helps you merge and resolve them.
We identify email by its subject, so please keep it as the
default one or alike, i.e. subject should pass the regex:
-C<qr{(PROBLEM|RECOVERY)\s+(Service|Host) Alert: ([^/]+)/(.+)\s+is\s+(\w+)}i>
+C<<< qr{(PROBLEM|RECOVERY)\s+(Service|Host) Alert: ([^/]+)/(.+)\s+is\s+(\w+)}i >>>
e.g. "PROBLEM Service Alert: localhost/Root Partition is WARNING":
@@ -40,11 +40,17 @@ PROBLEM, Service, localhost, Root Partition and WARNING
( Currently, we don't make use of problem_severity actually )
After the new ticket is created, the following is done:
-find all the other active tickets in the same queue with the same values of
-$category, $host and $problem_type, if C<RT->Config->Get('NagiosMergeTickets')>
-is true, merge all of them into the new ticket.
-If $type is 'RECOVERY', resolve the new ticket
+1. find all the other active tickets in the same queue( unless
+C<<< RT->Config->Get('NagiosSearchAllQueues') >>> is true, which will cause
+to search all the queues ) with the same values of $category, $host and
+$problem_type.
+
+2. if C<< RT->Config->Get('NagiosMergeTickets') >>> is true, merge all of them
+into the new ticket, if $type is 'RECOVERY', resolve the new created ticket.
+
+if C<< RT->Config->Get('NagiosMergeTickets') >>> is false and $type is
+'RECOVERY', resolve all the found tickets and the new created ticket.
=head1 AUTHOR
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list