Kolab2 Integration with OTRS

From Kolab wiki

Jump to: navigation, search

Contents

Introduction

Since Kolab offers you the possibility to add a high number of users to the system this can easily result in a high number of support request. To channel and manage these requests it is possible to install the Open Ticket Request System (OTRS) and integrate it with the Kolab user database.

Installation

The exact procedure depends on your distribution.

Make sure you install MySQL first. This is required for OTRS. You'll find instructions at Kolab2 Installation - Source

OpenPKG (Standard Kolab System)

NOTE: This has not been extensively tested on the OpenPKG version! Feedback welcome --Gwrobel 10:47, 25 May 2006 (BST)

Fetch and unpack the package:

cd /kolab/var
wget ftp://ftp.otrs.org/pub/otrs/otrs-2.0.4-01.tar.gz
tar xf otrs-2.0.4-01.tar.gz 
rm otrs-2.0.4-01.tar.gz

Add a otrs user:

useradd -d /kolab/var/otrs/ -c 'OTRS user' otrs
usermod -G kolab-n otrs

Generate stub config files:

cd otrs/Kernel/
cp Config.pm.dist Config.pm
cd Config
for foo in *.dist; do cp $foo `basename $foo .dist`; done
cd ../..

Correct permissions:

cd bin
./SetPermissions.sh /kolab/var/otrs otrs kolab-n kolab-n kolab-n 

Check presence of all perl modules:

/kolab/bin/perl otrs.checkModules

Install any missing packages by running

/kolab/bin/perl -e shell -MCPAN
> install X::Y::Z
(I had problems installing DBD::mysql since it tried to connect to the wrong socket path during testing, but you can force the install and it should work.)

I did this by executing "export PATH=/kolab/bin/:${PATH}". --Kaidenkewitz 08:24, 9 October 2006 (BST)

Check the install up to now:

/kolab/bin/perl -cw cgi-bin/index.pl
/kolab/bin/perl -cw PostMaster.pl

Both should result in Syntax OK

Gentoo

Follow the instructions at http://projects.gunnarwrobel.de/kolab/wiki/UseFlagOtrs

Configuration

OpenPKG (Standard Kolab System)

Install the database first:

cd /kolab/var/otrs/scripts/database/
/kolab/bin/mysql -u root -p -e 'create database otrs'
/kolab/bin/mysql -u root -p otrs < otrs-schema.mysql.sql
/kolab/bin/mysql -u root -p otrs < initial_insert.sql
/kolab/bin/mysql -u root -p otrs < otrs-schema-post.mysql.sql
/kolab/bin/mysql -u root -p -e 'GRANT ALL PRIVILEGES ON otrs.* TO otrs@localhost IDENTIFIED BY "some-pass" WITH GRANT OPTION;' 
/kolab/bin/mysqladmin -u root -p reload

Now create the configuration template /kolab/etc/kolab/templates/otrs-config.template

KOLAB_META_START
TARGET=/kolab/var/otrs/Kernel/Config.pm
PERMISSIONS=0644
OWNERSHIP=kolab-n:kolab-n
KOLAB_META_END
# --
# Kernel/Config.pm - Config file for OTRS kernel
# Copyright (C) 2001-2005 Martin Edenhofer <martin+code@otrs.org>
package Kernel::Config;
# --
sub Load {
   my $Self = shift;
   $Self->{'DatabaseHost'} = 'localhost';
   $Self->{'Database'} = 'otrs';
   $Self->{'DatabaseUser'} = 'otrs';
   $Self->{'DatabasePw'} = 'some-pass';
   $Self->{DatabaseDSN} = "DBI:mysql:database=$Self->{Database};host=$Self->{DatabaseHost};mysql_socket=/kolab/var/mysql/mysql.sock";
   $Self->{Home} = '/kolab/var/otrs';
   $Self->{'SystemID'} = 10;
   $Self->{'SecureMode'} = 1;
   $Self->{'Organization'} = 'Kolab';
   $Self->{'LogModule::LogFile'} = '/kolab/var/otrs/var/log/otrs.log';
   $Self->{'LogModule'} = 'Kernel::System::Log::File';
   $Self->{'FQDN'} = '@@@fqdnhostname@@@';
   $Self->{'DefaultLanguage'} = 'de';
   $Self->{'DefaultCharset'} = 'utf-8';
   $Self->{'AdminEmail'} = 'hostmaster@@@@fqdnhostname@@@';
   # CustomerUser
   $Self->{CustomerUser} = {
       Name => 'LDAP Source',
       Module => 'Kernel::System::CustomerUser::LDAP',
       Params => {
           Host => 'localhost',
           BaseDN => '@@@base_dn@@@',
           SSCOPE => 'one',
           UserDN => 'cn=nobody,cn=internal,@@@base_dn@@@',
           UserPw => '@@@php_pw@@@',
           AlwaysFilter => '',
           Params => {
               port => 389,
               timeout => 120,
               async => 0,
               version => 3,
           },
       },
       # customer uniq id
       CustomerKey => 'uid',
       # customer #
       CustomerID => 'mail',
       CustomerUserListFields => ['cn', 'mail'],
       CustomerUserSearchFields => ['uid', 'cn', 'mail'],
       CustomerUserSearchPrefix => '',
       CustomerUserSearchSuffix => '*',
       CustomerUserSearchListLimit => 250,
       CustomerUserPostMasterSearchFields => ['mail'],
       CustomerUserNameFields => ['givenname', 'sn'],
       # show now own tickets in customer panel, CompanyTickets
       CustomerUserExcludePrimaryCustomerID => 0,
       # admin can't change customer preferences
       AdminSetPreferences => 0,
       Map => [
           # note: Login, Email and CustomerID needed!
           # var, frontend, storage, shown (1=always,2=lite), required, storage-type, http-link, readonly
           [ 'UserSalutation', 'Title',      'title',           1, 0, 'var', , 0 ],
           [ 'UserFirstname',  'Firstname',  'givenname',       1, 1, 'var', , 0 ],
           [ 'UserLastname',   'Lastname',   'sn',              1, 1, 'var', , 0 ],
           [ 'UserLogin',      'Username',   'uid',             1, 1, 'var', , 0 ],
           [ 'UserEmail',      'Email',      'mail',            1, 1, 'var', , 0 ],
           [ 'UserCustomerID', 'CustomerID', 'mail',            0, 1, 'var', , 0 ],
           [ 'UserPhone',      'Phone',      'telephonenumber', 1, 0, 'var', , 0 ],
           [ 'UserAddress',    'Address',    'postaladdress',   1, 0, 'var', , 0 ],
           [ 'UserComment',    'Comment',    'description',     1, 0, 'var', , 0 ],
       ],
   };
   # This is an example configuration for an LDAP auth. backend.
   # (take care that Net::LDAP is installed!)
   $Self->{'AuthModule'} = 'Kernel::System::Auth::LDAP';
   $Self->{'AuthModule::LDAP::Host'} = 'localhost';
   $Self->{'AuthModule::LDAP::BaseDN'} = '@@@base_dn@@@';
   $Self->{'AuthModule::LDAP::UID'} = 'uid';
   $Self->{'AuthModule::LDAP::SearchUserDN'} = 'cn=nobody,cn=internal,@@@base_dn@@@';
   $Self->{'AuthModule::LDAP::SearchUserPw'} = '@@@php_pw@@@';
   $Self->{'AuthModule::LDAP::AlwaysFilter'} = ;
   $Self->{'AuthModule::LDAP::Params'} = {
       port => 389,
       timeout => 120,
       async => 0,
       version => 3,
   };
   # UserSyncLDAPMap
   # (map if agent should create/synced from LDAP to DB after login)
   $Self->{UserSyncLDAPMap} = {
       # DB -> LDAP
       Firstname => 'givenName',
       Lastname => 'sn',
       Email => 'mail',
   };
   $Self->{UserSyncLDAPGroups} = [
       'user',];
   # UserTable
   $Self->{DatabaseUserTable} = 'system_user';
   $Self->{DatabaseUserTableUserID} = 'id';
   $Self->{DatabaseUserTableUserPW} = 'pw';
   $Self->{DatabaseUserTableUser} = 'login';
   # This is an example configuration for an LDAP auth. backend.
   # (take care that Net::LDAP is installed!)
   $Self->{'Customer::AuthModule'} = 'Kernel::System::CustomerAuth::LDAP';
   $Self->{'Customer::AuthModule::LDAP::Host'} = 'localhost';
   $Self->{'Customer::AuthModule::LDAP::BaseDN'} = '@@@base_dn@@@';
   $Self->{'Customer::AuthModule::LDAP::UID'} = 'uid';
   $Self->{'Customer::AuthModule::LDAP::SearchUserDN'} = 'cn=nobody,cn=internal,@@@base_dn@@@';
   $Self->{'Customer::AuthModule::LDAP::SearchUserPw'} = '@@@php_pw@@@';
   $Self->{'Customer::AuthModule::LDAP::AlwaysFilter'} = ;
   $Self->{'Customer::AuthModule::LDAP::Params'} = {
       port => 389,
       timeout => 120,
       async => 0,
       version => 3,
   };
}
# ---------------------------------------------------- #
# needed system stuff (don't edit this)                #
# ---------------------------------------------------- #
use strict;
use vars qw(@ISA $VERSION);
use Kernel::Config::Defaults;
push (@ISA, 'Kernel::Config::Defaults');
$VERSION = '$Revision: 1.16 $';
$VERSION =~ s/^\$.*:\W(.*)\W.+?$/$1/;
# -----------------------------------------------------#
1;

The '' did not appear in my Browser, so after copying the template I got Errors when testing "/kolab/bin/perl -cw cgi-bin/index.pl" because the above mentioned sign in the line AlwaysFilter => '', was missing This happened some lines further down as well, the same parameter and with the parameter CustomerUserSearchPrefix => '', the error message is: Odd number of elements in anonymous hash --Kaidenkewitz 08:34, 9 October 2006 (BST)

Fixed the '' issue. --Gwrobel 09:00, 29 January 2007 (GMT)


Ensure that you replaced the mysql password with the one you chose before!

Now run kolabconf:

/kolab/sbin/kolabconf 

And verify that /var/www/kolab/otrs-2.0.4/Kernel/Config.pm got properly created.

Now check that otrs works as expected:

cd /kolab/var/otrs/bin
/kolab/bin/perl cgi-bin/index.pl | grep ERROR

Should yield nothing.

Gentoo

Follow the instructions at http://projects.gunnarwrobel.de/kolab/wiki/UseFlagOtrs

Apache setup

OpenPKG (Standard Kolab System)

You tune the apache configuration to your specific needs but the basic directives should look something like this:

ScriptAlias /otrs/ "/kolab/var/otrs/bin/cgi-bin/"
Alias /otrs-web/ "/kolab/var/otrs/var/httpd/htdocs/"
<Directory "/kolab/var/otrs/bin/cgi-bin/">
   AllowOverride None
   Options +ExecCGI -Includes
   Order allow,deny
   Allow from all
</Directory>
<Directory "/kolab/var/otrs/var/httpd/htdocs/">
   AllowOverride None
   Order allow,deny
   Allow from all
</Directory>

Gentoo

If you installed the tool according to the instructions, your customer frontend should be located at

http://support.domainname.tld

and the admin frontend at

http://ticket.domainname.tld

Creating an admin user

The only thing you need to do in order to create an administrator for the system is to log in as any of you Kolab users into the ticket administration frontend. Once you did that the user has been added into the internal otrs database and you can make this person an admin by issuing:

/kolab/var/otrs/bin/otrs.addUser2Group -g admin -u first_user@mydomain.de -p rw

There is nothing you need to do in order to allow them submitting tickets. Just creating a user in the kolab administration frontend automagically allows access to the otrs system.

Personal tools