how to run GenericAgent from the command line?

Moderator: crythias

Locked
dunga
Znuny newbie
Posts: 1
Joined: 25 May 2011, 11:50
Znuny Version: 3.0.7

how to run GenericAgent from the command line?

Post by dunga »

I want to be able to make GenericAgent run jobs from the commandline. This is because I want more scheduling flexibility than the webinterface offers.

This is what I'm trying :

sudo -u otrs /opt/otrs/bin/otrs.GenericAgent.pl -c "Kernel::Config::GenericAgentTerugkeervoorbeeld"

here's the content of /opt/otrs/Kernel/Config/GenericAgentTerugkeervoorbeeld :

Code: Select all

# --
# Kernel/Config/GenericAgent.pm - config file of generic agent
# Copyright (C) 2001-2010 xxx, http://otrs.org/
# --
# $Id: GenericAgent.pm.dist,v 1.14 2010/12/03 09:58:00 bes Exp $
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --

package Kernel::Config::GenericAgent;

use strict;
use warnings;

use vars qw($VERSION @ISA @EXPORT %Jobs);
require Exporter;
@ISA     = qw(Exporter);
@EXPORT  = qw(%Jobs);
$VERSION = qw($Revision: 1.14 $)[1];

# -----------------------------------------------------------------------
# config options
# -----------------------------------------------------------------------
%Jobs = (

   # [name of job] -> send escalation notifications
#   'send escalation notifications' => {
#       Escalation => 1,
#       # new ticket properties
#       New => {
#           Module => 'Kernel::System::GenericAgent::NotifyAgentGroupOfCustomQueue',
#       },
#   },
   # insert your jobs (see Kernel/Config/GenericAgent.pm.examples)
   'terugkeervoorbeeld' => {
      TicketNumber => '2011052001000029',
      New => {
         State => 'new',
         Lock => 'unlock'
         },
      },

);
# -----------------------------------------------------------------------
# end of config options
# -----------------------------------------------------------------------
1;
This is on OTRS 3.0.7 on Ubuntu 10.04.2 LTS

When I run this command I just get the prompt back. What am I doing wrong ?

Thank you very much in advance!
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: how to run GenericAgent from the command line?

Post by crythias »

change the package name.
package Kernel::Config::GenericAgent
should be
package Kernel::Config::GenericAgentTerugkeervoorbeeld
make sure the file has .pm suffix.
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