How to create a generic agent entry upon package installation?

English! place to talk about development, programming and coding
Post Reply
martinv2
Znuny newbie
Posts: 13
Joined: 30 Jun 2014, 14:49
Znuny Version: 6.4.4
Real Name: Martin Vorländer
Company: PDV-Systeme GmbH
Contact:

How to create a generic agent entry upon package installation?

Post by martinv2 »

Hi all!

I've written a pm file that is run as a generic agent custom module. I packaged it for better managebility/upgradability.

When I install the package to a new OTRS System I have to remember to create the generic agent entry that uses the module.
Is there a way for the package Installation process to create that entry automagically?

TIA,

Martin
OTRS 6.4.4, Ubuntu 20.04.5 LTS with MariaDB 10.3.37
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: How to create a generic agent entry upon package installation?

Post by reneeb »

You can create a DatabaseInstall section in your .sopm (http://otrs.github.io/doc/manual/develo ... ample-sopm). In that section you can add a Insert (see https://github.com/reneeb/OTRS-OPM-Make ... base.t#L82)
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
martinv2
Znuny newbie
Posts: 13
Joined: 30 Jun 2014, 14:49
Znuny Version: 6.4.4
Real Name: Martin Vorländer
Company: PDV-Systeme GmbH
Contact:

Re: How to create a generic agent entry upon package installation?

Post by martinv2 »

Thanks for the pointer, Renée. I would never have thought of writing to the OTRS tables directly. But that seems a bit easier than a CodeInstall section using $GenericAgentObject->JobAdd() - because I'd have to figure out the specific syntax for the events that trigger the agent (i.e. a deep dive into OTRS' perl code).

cu,
Martin
OTRS 6.4.4, Ubuntu 20.04.5 LTS with MariaDB 10.3.37
Post Reply