execute generic agents on CLI

Moderator: crythias

Post Reply
nscblauensteiner
Znuny newbie
Posts: 28
Joined: 15 Apr 2019, 09:34
Znuny Version: 6.0.44
Real Name: Lukas B.

execute generic agents on CLI

Post by nscblauensteiner »

Hello everyone,

I would like to execute a generic agent task named "delete_tickets_older_than_1_year" on the cli,
because it's just more flexible than waiting for the response from the web service.

Best regards, Lukas
root
Administrator
Posts: 3934
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: execute generic agents on CLI

Post by root »

Hi,

Configure a schedule for this job, like every Sunday. The job will be executed then by the daemon.

- Roy
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
nscblauensteiner
Znuny newbie
Posts: 28
Joined: 15 Apr 2019, 09:34
Znuny Version: 6.0.44
Real Name: Lukas B.

Re: execute generic agents on CLI

Post by nscblauensteiner »

Hello Roy,

I understand your point. I want to manually execute a generic agent task on the CLI,
is this possible?

Best regards, Lukas
root
Administrator
Posts: 3934
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: execute generic agents on CLI

Post by root »

Hi,

GenericAgents which are created via AdminGenericAgent can't be executed manually via CLI. Via CLI you can execute your own modules with the command bin/otrs.Console.pl Maint::GenericAgent::Run

You have to write your own module which execute the ticket search and loop over the result to delete the tickets.

I recommend using my first approach and keep the GA disabled when not required.

- Roy
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
Post Reply