Running an external program when an OTRS event occurs

Moderator: crythias

Locked
vbfoobar
Znuny newbie
Posts: 4
Joined: 25 Feb 2011, 08:15
Znuny Version: 3

Running an external program when an OTRS event occurs

Post by vbfoobar »

Perhaps a FAQ,and I am new to OTRS, but I do not find answer:
- What is the general method to customize OTRS so that, when an event
of my choice occurs (typically: when a ticket with highest priority is created;
or when a new ticket is created in such or such queue; or when the priority
of a ticket changes to the highest...), an external program of my choice (possibly
a shell script) is automatically launched?
- Moreover, how do you specify parameters to the external program,
such that the involved ticket number, the queue, the priority level and other
characteristics?

Thanks in advance for your hints, and even better, practical working examples!
vbfoobar
Znuny newbie
Posts: 4
Joined: 25 Feb 2011, 08:15
Znuny Version: 3

Re: Running an external program when an OTRS event occurs

Post by vbfoobar »

any suggestion?
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Running an external program when an OTRS event occurs

Post by crythias »

Generic Agent/Ticket Commands
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
vbfoobar
Znuny newbie
Posts: 4
Joined: 25 Feb 2011, 08:15
Znuny Version: 3

Re: Running an external program when an OTRS event occurs

Post by vbfoobar »

Thanks for the answer. The problem with this "Generic Agent" suggestion is that,
as far as I understand, program execution is done through a periodic cron, and thus,
is more or less delayed.
In fact I am looking for a method to immediately (without delay) run a command,
for example, when a high-priority ticket is created. I was wondering if in the OTRS
code there are dedicated "hooks", or at least code locations appropriate to cleanly
hook and invoke external commands...
Thanks
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Running an external program when an OTRS event occurs

Post by crythias »

You could hack notification (event) or use it to send an email to a listening service that runs things. A very minimal way to do that last is to setup an email address on a linux box that runs procmail
http://partmaps.org/era/procmail/mini-f ... pass-envar
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
Locked