Scrip to change subject for tickets created w/rt-mailgate

Management here has requested that all major and critical alarms from
our monitoring system are emailed to RT as well as the pagers so that we
can run daily reports on the tickets and provide a high level view of
what’s happened overnight for engineering. The monitoring package sends
out email with the subject line “Event Active!” and the vendor has
informed us this can’t change. Subsequently we’d like to have the event
message which is currently contained in the message body show up in the
subject field on the ticket so that the queue view and subsequent
reports will show the nature of each ticket without having to open it.
For instance, a ticket which currently looks like this:

Sub: Event Active!
Body: 110524 06:34:00 ISD4000 LVL=Maj 10.31.50.11 Redundant card in
slot 4 is active, check health of client modules - Active!

Would look like this:

Sub: LVL=Maj 10.31.50.11 Redundant card in slot 4 is active, check
health of client modules - Active!
Body: 110524 06:34:00 ISD4000 LVL=Maj 10.31.50.11 Redundant card in
slot 4 is active, check health of client modules - Active!

I’m not sure where to start as far as the scrip and template go. Any
suggestions?
Thanks,

Rob Sullivan
Systems Engineer, Peerless Network Inc
rsullivan@peerlessnetwork.com
312-506-0948

Hi,

You need scrips for sure. Start writing required condition. Put
something trivial as action, for example log a string into log files
with $RT::Logger object. As condition you need something like: on
create and subject is “event active!”. Wiki has snippets for all of
that. Try. Return back if you fail with more questions.On Tue, May 24, 2011 at 11:00 PM, Sullivan, Rob rsullivan@peerlessnetwork.com wrote:

Management here has requested that all major and critical alarms from
our monitoring system are emailed to RT as well as the pagers so that we
can run daily reports on the tickets and provide a high level view of
what’s happened overnight for engineering. The monitoring package sends
out email with the subject line “Event Active!” and the vendor has
informed us this can’t change. Subsequently we’d like to have the event
message which is currently contained in the message body show up in the
subject field on the ticket so that the queue view and subsequent
reports will show the nature of each ticket without having to open it.
For instance, a ticket which currently looks like this:

Sub: Event Active!
Body: 110524 06:34:00 ISD4000 LVL=Maj 10.31.50.11 Redundant card in
slot 4 is active, check health of client modules - Active!

Would look like this:

Sub: LVL=Maj 10.31.50.11 Redundant card in slot 4 is active, check
health of client modules - Active!
Body: 110524 06:34:00 ISD4000 LVL=Maj 10.31.50.11 Redundant card in
slot 4 is active, check health of client modules - Active!

I’m not sure where to start as far as the scrip and template go. Any
suggestions?
Thanks,

Rob Sullivan
Systems Engineer, Peerless Network Inc
rsullivan@peerlessnetwork.com
312-506-0948

Best regards, Ruslan.

Rob,

We have our job schedular send email to RT when a job ends abnormally. Each
job can have it’s “To:” email address specified so it’s easy for us to send
it to the correct support Queue (different jobs supported by different
Queue/teams). In your instance, you might want to use Subject tags to get
the emails to the right Queue, if your using different Queues like us. Then
the scrip for each Queue can be more specific in custom conditions.

Kenn
LBNLOn Tue, May 24, 2011 at 12:00 PM, Sullivan, Rob < rsullivan@peerlessnetwork.com> wrote:

Management here has requested that all major and critical alarms from
our monitoring system are emailed to RT as well as the pagers so that we
can run daily reports on the tickets and provide a high level view of
what’s happened overnight for engineering. The monitoring package sends
out email with the subject line “Event Active!” and the vendor has
informed us this can’t change. Subsequently we’d like to have the event
message which is currently contained in the message body show up in the
subject field on the ticket so that the queue view and subsequent
reports will show the nature of each ticket without having to open it.
For instance, a ticket which currently looks like this:

Sub: Event Active!
Body: 110524 06:34:00 ISD4000 LVL=Maj 10.31.50.11 Redundant card in
slot 4 is active, check health of client modules - Active!

Would look like this:

Sub: LVL=Maj 10.31.50.11 Redundant card in slot 4 is active, check
health of client modules - Active!
Body: 110524 06:34:00 ISD4000 LVL=Maj 10.31.50.11 Redundant card in
slot 4 is active, check health of client modules - Active!

I’m not sure where to start as far as the scrip and template go. Any
suggestions?
Thanks,

Rob Sullivan
Systems Engineer, Peerless Network Inc
rsullivan@peerlessnetwork.com
312-506-0948

Sorry for the delay. The condition isn’t an issue here as the scrip will apply to everything that comes into the queue. I know I can change the subject easily with:

$self->TicketObj->SetSubject( “EXTRACTED VALUE” );

Where I’m stumbling is in extracting the desired info from the history on the ticket and turning that into a usable for the SetSubject string.
Tx,
RobFrom: ruslan.zakirov@gmail.com [mailto:ruslan.zakirov@gmail.com] On Behalf Of Ruslan Zakirov
Sent: Tuesday, May 24, 2011 4:42 PM
To: Sullivan, Rob
Cc: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] scrip to change subject for tickets created w/rt-mailgate

Hi,

You need scrips for sure. Start writing required condition. Put
something trivial as action, for example log a string into log files
with $RT::Logger object. As condition you need something like: on
create and subject is “event active!”. Wiki has snippets for all of
that. Try. Return back if you fail with more questions.