Duplicate ticket detection at OnCreate

Hi all,

we have many systems that generate emails on conditions (success, fail,
warn etc), and many of these will quite vocally notify you when something
goes wrong. So if you have 100 systems all emailing you every 5 minutes
about the same underlying problem… the queue rapidly gets out of control.

Are there any extensions / plugins / scrips etc that can be used to look
for duplicate tickets on creation? I know there’s a Nagios plugin - but
these aren’t Nagios tickets so you don’t have a system changing state. In
this case the emails all have identical subject tags (like SUBJECT: Warning
backup failure on host(x)); occur within a short time interval but because
they’re generated from a remote system none of them have an RT tag like
[myrtsystem #12345].

We currently manage it when it occurs by running the following:

rt list “queue = ‘myqueue’ and status = ‘new’ and subject=‘My Broken
Ticket Subject’” -i | rt edit - set status=‘deleted’

which works well (much faster than the webgui) but it would be nice if we
could simply delete them on incoming or merge them or something like that.

Thanks!

Chris

duplicate tickets on creation? I know there’s a Nagios plugin - but these
aren’t Nagios tickets so you don’t have a system changing state. In this case
the emails all have identical subject tags (like SUBJECT: Warning backup
failure on host(x)); occur within a short time interval but because they’re
generated from a remote system none of them have an RT tag like [myrtsystem #
12345].

The Nagios plugin is just merging after the fact based on Subject.
You could do the same thing using your subjects. Just write a Scrip
which On Create looks for an existing ticket with the Subject and
merges (or calls SetStatus(‘deleted’)).

If you’re feeling ambitious, write a MailPlugin that transparently
adds the mail to the existing ticket, or does something else with it.

Heck, you could filter at the mail level using bin/rt to search for
tickets and blackhole mail from getting to RT if you find tickets with
the same subject.

-kevin

Heck, you could filter at the mail level using bin/rt to search for
tickets and blackhole mail from getting to RT if you find tickets with
the same subject.

Yes, we do exactly that for a similar case, it works nicely.

We use procmail to pipe the mail message through a script that calls
bin/rt looking for existing ticket with similar subjects. In our case
we want to merge the new message into the existing ticket, so we simply
alter the Subject header adding the RT ticket number, something like this:

my $rt_cli = ‘/usr/local/bin/rt’;
my $timeout_cmd = ‘/usr/bin/timeout’;

my $ticket_response = $timeout_cmd 5 $rt_cli ls -i -t ticket "Subject like whatever-you-like";
if (my ($ticket) = $ticket_response =~ m!^ticket/(\d+)\s*!) {
printf STDERR “Found existing RT-ticket $ticket\n” if $debug;
$in_subject .= " [example.org #${ticket}]";
}

You could, of course ,skip the message altogether.

  • Vegard V -