GenericAgent Custom Module

Moderator: crythias

Post Reply
mohsinkhan009
OTRS newbie
Posts: 64
Joined: 02 Sep 2015, 08:47
OTRS Version?: OTRS-Rel-5

GenericAgent Custom Module

Post by mohsinkhan009 »

Capture.JPG
Hi All,

I wan to understand How to use the Execute Custom Module of OTRS. I have written one custom module and use that module name in the text box and run for the ticket the output is not getting, below is the content of CustomModule.pm

package Kernel::System::GenericAgent::CustomModule;

use strict;
use warnings;

our @ObjectDependencies = (
'Kernel::System::Log',
);

sub new {
my ( $Type, %Param ) = @_;

# allocate new hash for object
my $Self = {};
bless( $Self, $Type );

# 0=off; 1=on;
$Self->{Debug} = $Param{Debug} || 0;

return $Self;
}

sub Run {
my ( $Self, %Param ) = @_;

$Kernel::OM->Get('Kernel::System::Log')->Log(
Priority => 'notice',
Message =>
"test",
);
}
1;


Error getting while running the custom module is:-
Use module (CustomModule) for Ticket (2019040343000014/28892).
[Wed Apr 3 17:36:09 2019][Error][Kernel::System::GenericAgent::_JobRunTicket][1355] Module CustomModule.pm not in @INC (/drbd/otrs/bin/Custom /drbd/otrs/bin/Kernel/cpan-lib /drbd/otrs/bin /drbd/otrs/bin/cgi-bin/../../Custom /drbd/otrs/bin/cgi-bin/../../Kernel/cpan-lib /drbd/otrs/bin/cgi-bin/../.. /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .)
You do not have the required permissions to view the files attached to this post.

root
Moderator
Posts: 2383
Joined: 18 Dec 2007, 12:23
OTRS Version?: 4/5/6
Real Name: Roy Kaldung
Company: Znuny Inc.
Contact:

Re: GenericAgent Custom Module

Post by root »

Hi,

Try Kernel::System::GenericAgent::CustomModule for the module as the GenericAgent parameter.

- Roy
OTRS 5/6 CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Do you need professional services for the ((OTRS)) Community Edition? Check out https://www.znuny.com/

mohsinkhan009
OTRS newbie
Posts: 64
Joined: 02 Sep 2015, 08:47
OTRS Version?: OTRS-Rel-5

Re: GenericAgent Custom Module

Post by mohsinkhan009 »

Great thanks it is working and printing the relevant in log file

[Wed Apr 3 17:51:16 2019][Notice][Kernel::System::GenericAgent::_JobRunTicket] Use module (Kernel::System::GenericAgent::CustomModule) for Ticket (2019040343000014/28892).
[Wed Apr 3 17:51:16 2019][Notice][Kernel::System::GenericAgent::CustomModule::Run] Increase priority of

Post Reply