[Bps-public-commit] RT-Extension-Nagios branch, master, updated. 434b35d0c6b845143c61d7470c5d95043d65cb5b

? sunnavy sunnavy at bestpractical.com
Mon Jan 10 00:22:12 EST 2011


The branch, master has been updated
       via  434b35d0c6b845143c61d7470c5d95043d65cb5b (commit)
       via  f8c7d6dc6988e59bcac1065be63db4452dc81674 (commit)
       via  785c2f371e4f09d7696f762795177626edaa5bb3 (commit)
       via  12ecb2841f7aa5a004ace4784d23645ec516073a (commit)
      from  4779265e35e528ace10fd3300ccfd383592bc6cc (commit)

Summary of changes:
 Changes                              |    9 +++++++++
 META.yml                             |    2 +-
 lib/RT/Action/UpdateNagiosTickets.pm |    6 ++++--
 lib/RT/Extension/Nagios.pm           |    4 ++--
 4 files changed, 16 insertions(+), 5 deletions(-)

- Log -----------------------------------------------------------------
commit 12ecb2841f7aa5a004ace4784d23645ec516073a
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Mon Jan 10 12:54:37 2011 +0800

    problem_type can be empty if it's a host problem, thanks to marc

diff --git a/lib/RT/Action/UpdateNagiosTickets.pm b/lib/RT/Action/UpdateNagiosTickets.pm
index 62cbd61..f9586cb 100644
--- a/lib/RT/Action/UpdateNagiosTickets.pm
+++ b/lib/RT/Action/UpdateNagiosTickets.pm
@@ -26,9 +26,10 @@ sub Commit {
     return unless $subject;
     if ( my ( $type, $category, $host, $problem_type, $problem_severity ) =
         $subject =~
-        m{(PROBLEM|RECOVERY)\s+(Service|Host) Alert: ([^/]+)/(.*)\s+is\s+(\w+)}i
+m{(PROBLEM|RECOVERY)\s+(Service|Host) Alert: ([^/]+)/?(.*)\s+is\s+(\w+)}i
       )
     {
+        $problem_type ||= '';
         $RT::Logger->info(
 "Extracted type, category, host, problem_type and problem_severity from
 subject with values $type, $category, $host, $problem_type and $problem_severity"
@@ -37,7 +38,8 @@ subject with values $type, $category, $host, $problem_type and $problem_severity
         $tickets->LimitQueue( VALUE => $new_ticket->Queue )
           unless RT->Config->Get('NagiosSearchAllQueues');
         $tickets->LimitSubject(
-            VALUE    => "$category Alert: $host/$problem_type",
+            VALUE => "$category Alert: $host"
+              . ( $problem_type ? "/$problem_type" : '' ),
             OPERATOR => 'LIKE',
         );
         $tickets->LimitStatus(

commit 785c2f371e4f09d7696f762795177626edaa5bb3
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Mon Jan 10 12:56:18 2011 +0800

    allow type of acknowledgement thanks to marc

diff --git a/lib/RT/Action/UpdateNagiosTickets.pm b/lib/RT/Action/UpdateNagiosTickets.pm
index f9586cb..0c643d5 100644
--- a/lib/RT/Action/UpdateNagiosTickets.pm
+++ b/lib/RT/Action/UpdateNagiosTickets.pm
@@ -26,7 +26,7 @@ sub Commit {
     return unless $subject;
     if ( my ( $type, $category, $host, $problem_type, $problem_severity ) =
         $subject =~
-m{(PROBLEM|RECOVERY)\s+(Service|Host) Alert: ([^/]+)/?(.*)\s+is\s+(\w+)}i
+m{(PROBLEM|RECOVERY|ACKNOWLEDGEMENT)\s+(Service|Host) Alert: ([^/]+)/?(.*)\s+is\s+(\w+)}i
       )
     {
         $problem_type ||= '';

commit f8c7d6dc6988e59bcac1065be63db4452dc81674
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Mon Jan 10 13:04:19 2011 +0800

    package file update

diff --git a/Changes b/Changes
index 5077045..277a2e4 100644
--- a/Changes
+++ b/Changes
@@ -1,2 +1,11 @@
+0.03 Mon Jan 10 13:00:31 CST 2011
+
+    acknowledgement support
+    problem_type can be empty
+
+0.02 Tue Nov  3 02:04:14 GMT 2009
+
+    fix scrip action name
+
 0.01 Thu Sep 24 20:58:08 CST 2009
     initial release
diff --git a/META.yml b/META.yml
index 00dedc4..41f4632 100644
--- a/META.yml
+++ b/META.yml
@@ -19,4 +19,4 @@ no_index:
     - inc
 resources:
   license: http://dev.perl.org/licenses/
-version: 0.01
+version: 0.03
diff --git a/lib/RT/Extension/Nagios.pm b/lib/RT/Extension/Nagios.pm
index 17ab772..f71f801 100644
--- a/lib/RT/Extension/Nagios.pm
+++ b/lib/RT/Extension/Nagios.pm
@@ -9,7 +9,7 @@ RT::Extension::Nagios - Merge and resolve Nagios tickets
 
 =cut
 
-our $VERSION = '0.01';
+our $VERSION = '0.03';
 
 1;
 

commit 434b35d0c6b845143c61d7470c5d95043d65cb5b
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Mon Jan 10 13:17:34 2011 +0800

    doc update

diff --git a/lib/RT/Extension/Nagios.pm b/lib/RT/Extension/Nagios.pm
index f71f801..8638855 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|ACKNOWLEDGEMENT)\s+(Service|Host) Alert: ([^/]+)/?(.+)\s+is\s+(\w+)}i >>>
 
 e.g.  "PROBLEM Service Alert: localhost/Root Partition is WARNING":
 

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list