Re: [rt-users] Still issues with Nagios Autoclose - Commit dies

2011-07-05 Thread Kevin Falcone
On Tue, Jul 05, 2011 at 04:07:40PM +0100, Giuseppe Sollazzo wrote:
 Hi all,
 I'm experimenting with the Nagios Autoclose.
 
 It seems I get an abort caused by a null pointer exception.

Giuseppe

This appears to be the same error you were seeing 2 weeks ago when
sunnavy replied with a comment and possible solution.
Have you implemented his code change?

-kevin

 [Tue Jul  5 14:47:02 2011] [info]: Extracted type, category, host,
 problem_type and problem_severity from
 subject with values RECOVERY, Service, sambadev2, sambadev2_root and
 OK 
 (/opt/rt4/local/plugins/RT-Extension-Nagios/lib/RT/Action/UpdateNagiosTickets.pm:35)
 [Tue Jul  5 14:47:02 2011] [error]: Scrip Commit 12 died. - Can't
 call method SetStatus on an undefined value at 
 /opt/rt4/local/plugins/RT-Extension-Nagios/lib/RT/Action/UpdateNagiosTickets.pm
 line 76.
 
 Stack:
 [/opt/rt4/local/plugins/RT-Extension-Nagios/lib/RT/Action/UpdateNagiosTickets.pm:76]
   [/opt/rt4/sbin/../lib/RT/ScripAction.pm:232]
   [/opt/rt4/sbin/../lib/RT/Scrip.pm:475]
   [/opt/rt4/sbin/../lib/RT/Scrips.pm:189]
   [/opt/rt4/sbin/../lib/RT/Transaction.pm:198]
   [/opt/rt4/sbin/../lib/RT/Record.pm:1450]
   [/opt/rt4/sbin/../lib/RT/Ticket.pm:669]
   [/opt/rt4/sbin/../lib/RT/Interface/Email.pm:1495]
   [/opt/rt4/share/html/REST/1.0/NoAuth/mail-gateway:61]
 (/opt/rt4/sbin/../lib/RT/Scrip.pm:483)
 [Tue Jul  5 14:47:02 2011] [info]: Ticket 306 created in queue
 'Nagios' by gsollazz (/opt/rt4/sbin/../lib/RT/Ticket.pm:681)
 
 
 What is causing this?
 
 I have this as my reg exp:
 
 if ( my ( $type, $category, $host, $problem_type, $problem_severity ) =
 $subject =~
 m{(PROBLEM|RECOVERY|ACKNOWLEDGEMENT)\s+(Service|Host) Alert:
 ([^/]+)/?(.*)\s+is\s+(\w+)}i
   )
 #m{(PROBLEM|RECOVERY|ACKNOWLEDGEMENT)\s+alert\s+-\s+(Service|Host):
 ([^/]+)/?(.*)\s+is\s+(\w+)}i
 #qr{(PROBLEM|RECOVERY|ACKNOWLEDGEMENT)\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
 );
 my $tickets = RT::Tickets-new( $self-CurrentUser );
 $tickets-LimitQueue( VALUE = $new_ticket-Queue )
   unless RT-Config-Get('NagiosSearchAllQueues');
 $tickets-LimitSubject(
 VALUE = $category $host
   . ( $problem_type ? /$problem_type : '' ),
 OPERATOR = 'LIKE',
 );
 my @active = RT::Queue-ActiveStatusArray();
 for my $active (@active) {
 $tickets-LimitStatus(
 VALUE= $active,
 OPERATOR = '=',
 );
 }
 
 However, line 78 is just this:
 
 my ( $ret, $msg ) = $merged_ticket-SetStatus($resolved);
 
 So I assume somewhat it doesn't manage to merge the tickets. But why
 does it fail here and not, say, when it calls MergeInto?
 
 Thanks to anyone who can help,
 Giuseppe
 
 -- 
 
 
 Giuseppe Sollazzo
 Senior Systems Analyst
 Computing Services
 Information Services
 St. George's, University Of London
 Cranmer Terrace
 London SW17 0RE
 
 Email: gsoll...@sgul.ac.uk
 Direct Dial: +44 20 8725 5160
 Fax: +44 20 8725 3583
 
 
 
 
 2011 Training: http://bestpractical.com/services/training.html


pgp49SkyaloTB.pgp
Description: PGP signature


2011 Training: http://bestpractical.com/services/training.html

Re: [rt-users] Still issues with Nagios Autoclose - Commit dies

2011-07-05 Thread Giuseppe Sollazzo - mobile
Uhm... apologies to all.
 I'll head back to the archives, I must have done something weird with the 
codebase.

Kevin Falcone falc...@bestpractical.com wrote:

On Tue, Jul 05, 2011 at 04:07:40PM +0100, Giuseppe Sollazzo wrote:
 Hi all,
 I'm experimenting with the Nagios Autoclose.
 
 It seems I get an abort caused by a null pointer exception.

Giuseppe

This appears to be the same error you were seeing 2 weeks ago when
sunnavy replied with a comment and possible solution.
Have you implemented his code change?

-kevin

 [Tue Jul  5 14:47:02 2011] [info]: Extracted type, category, host,
 problem_type and problem_severity from
 subject with values RECOVERY, Service, sambadev2, sambadev2_root and
 OK 
 (/opt/rt4/local/plugins/RT-Extension-Nagios/lib/RT/Action/UpdateNagiosTickets.pm:35)
 [Tue Jul  5 14:47:02 2011] [error]: Scrip Commit 12 died. - Can't
 call method SetStatus on an undefined value at 
 /opt/rt4/local/plugins/RT-Extension-Nagios/lib/RT/Action/UpdateNagiosTickets.pm
 line 76.
 
 Stack:
 [/opt/rt4/local/plugins/RT-Extension-Nagios/lib/RT/Action/UpdateNagiosTickets.pm:76]
   [/opt/rt4/sbin/../lib/RT/ScripAction.pm:232]
   [/opt/rt4/sbin/../lib/RT/Scrip.pm:475]
   [/opt/rt4/sbin/../lib/RT/Scrips.pm:189]
   [/opt/rt4/sbin/../lib/RT/Transaction.pm:198]
   [/opt/rt4/sbin/../lib/RT/Record.pm:1450]
   [/opt/rt4/sbin/../lib/RT/Ticket.pm:669]
   [/opt/rt4/sbin/../lib/RT/Interface/Email.pm:1495]
   [/opt/rt4/share/html/REST/1.0/NoAuth/mail-gateway:61]
 (/opt/rt4/sbin/../lib/RT/Scrip.pm:483)
 [Tue Jul  5 14:47:02 2011] [info]: Ticket 306 created in queue
 'Nagios' by gsollazz (/opt/rt4/sbin/../lib/RT/Ticket.pm:681)
 
 
 What is causing this?
 
 I have this as my reg exp:
 
 if ( my ( $type, $category, $host, $problem_type, $problem_severity ) =
 $subject =~
 m{(PROBLEM|RECOVERY|ACKNOWLEDGEMENT)\s+(Service|Host) Alert:
 ([^/]+)/?(.*)\s+is\s+(\w+)}i
   )
 #m{(PROBLEM|RECOVERY|ACKNOWLEDGEMENT)\s+alert\s+-\s+(Service|Host):
 ([^/]+)/?(.*)\s+is\s+(\w+)}i
 #qr{(PROBLEM|RECOVERY|ACKNOWLEDGEMENT)\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
 );
 my $tickets = RT::Tickets-new( $self-CurrentUser );
 $tickets-LimitQueue( VALUE = $new_ticket-Queue )
   unless RT-Config-Get('NagiosSearchAllQueues');
 $tickets-LimitSubject(
 VALUE = $category $host
   . ( $problem_type ? /$problem_type : '' ),
 OPERATOR = 'LIKE',
 );
 my @active = RT::Queue-ActiveStatusArray();
 for my $active (@active) {
 $tickets-LimitStatus(
 VALUE= $active,
 OPERATOR = '=',
 );
 }
 
 However, line 78 is just this:
 
 my ( $ret, $msg ) = $merged_ticket-SetStatus($resolved);
 
 So I assume somewhat it doesn't manage to merge the tickets. But why
 does it fail here and not, say, when it calls MergeInto?
 
 Thanks to anyone who can help,
 Giuseppe
 
 -- 
 
 
 Giuseppe Sollazzo
 Senior Systems Analyst
 Computing Services
 Information Services
 St. George's, University Of London
 Cranmer Terrace
 London SW17 0RE
 
 Email: gsoll...@sgul.ac.uk
 Direct Dial: +44 20 8725 5160
 Fax: +44 20 8725 3583
 
 
 
 
 2011 Training: http://bestpractical.com/services/training.html



2011 Training: http://bestpractical.com/services/training.html


2011 Training: http://bestpractical.com/services/training.html