OTRS an Active Directory

Hilfe zu Znuny Problemen aller Art
Locked
olafi
Znuny newbie
Posts: 4
Joined: 29 Nov 2007, 17:30

OTRS an Active Directory

Post by olafi »

Hallo Forum User,
ich weiss für einige ist es ein leidiges Thema,
ich aber laufe bald die Wand hoch :)

Es geht um die OTRS Anbindung an das Active Directory.

Ich möchte unsere AD User als Kunden
und die Admins als Supporter einbinden.

Nun habe ich folgendes Problem.
Sobald ich die rcotrs restart ausführe, folgt dieser Fehlerstring:

Shutting down OTRS
Disable /opt/otrs/bin/PostMaster.pl ... done.
no crontab for otrs
Shutting down cronjobs ... failed!
Starting OTRS
Checking Apache ... done.
Checking MySQL ... done.
Checking database connect... (DBI connect('database=otrs;host=localhost;','otrs',...) failed: Access denied for user 'otrs'@'localhost' (using password: YES) at /opt/otrs/Kernel/System/DB.pm line 197
ERROR: OTRS-CheckDB-10 Perl: 5.8.8 OS: linux Time: Fri Nov 30 00:56:58 2007

Message: Access denied for user 'otrs'@'localhost' (using password: YES)

Traceback (19444):
Module: Kernel::System::DB::new (v1.75) Line: 174
Module: /opt/otrs/bin/CheckDB.pl (v1.17) Line: 49

No database connect!)
----------------------------------------------------------------------------
Error: Maybe your database isn't configured yet?
----------------------------------------------------------------------------


Try the web installer to configure your database:


-->> http://vmsuse.tiptop.local/otrs/installer.pl <<--


----------------------------------------------------------------------------
or configure your database with README.database (DB - Setup Example)
----------------------------------------------------------------------------
failed



Mein Config.pm sieht wie folgt aus:


Code: Select all


# ---------------------------------------------------- #
#Ldap Authentifizierung gegen AD


package Kernel::Config;


sub Load {

$Self->{'AuthModule'} = 'Kernel::System::Auth::LDAP';
$Self->{'AuthModule::LDAP::Host'} = 'pmdc001.domain.local';
$Self->{'AuthModule::LDAP::BaseDN'} = 'DC=domain,DC=local';
$Self->{'AuthModule::LDAP::UID'} = 'sAMAccountName';

$Self->{'AuthModule::LDAP::SearchUserDN'} = 'cn=administrator, ou=Administrators and Operators, ou=Infrastructure Objects, dc=domain, dc=local';
$Self->{'AuthModule::LDAP::SearchUserPw'} = 'Kennwort';


# Kundenauthentifizierung
$Self->{'Customer::AuthModule'} = 'Kernel::System::CustomerAuth::LDAP';
$Self->{'Customer::AuthModule::LDAP::Host'} = 'pmdc001.domain.local';
$Self->{'Customer::AuthModule::LDAP::BaseDN'} = 'ou=users, ou=1001, ou=AHP Companies, dc=domain ,dc=local'; 
$Self->{'Customer::AuthModule::LDAP::UID'} = 'sAMAccountName';


#$Self->{'AuthModule::LDAP::SearchUserDN'} = 'cn=administrator, ou=Administrators and Operators, ou=Infrastructure Objects, dc=domain, dc=local';
#$Self->{'AuthModule::LDAP::SearchUserPw'} = 'Kennwort';

# Datenbank
# CustomerUser
# (customer user database backend and settings)
$Self->{CustomerUser} = {
Name => 'Datenbank',
Module => 'Kernel::System::CustomerUser::DB',
Params => { Table => 'customer_user',
# to use an external database
# DSN => 'DBI:odbc:yourdsn',
# DSN => 'DBI:mysql:database=customerdb;host=customerdbhost',
# User => '', Password => '',
},
# customer uniq id
CustomerKey => 'login',
CustomerID => 'customer_id',
CustomerValid => 'valid_id',
CustomerUserListFields => ['first_name', 'last_name', 'email'],
#CustomerUserListFields => ['login', 'first_name', 'last_name', 'customer_id', 'email'],
CustomerUserSearchFields => ['login', 'last_name', 'customer_id'],
CustomerUserSearchPrefix => '',
CustomerUserSearchSuffix => '*',
CustomerUserSearchListLimit => 250,
CustomerUserPostMasterSearchFields => ['email'],
CustomerUserNameFields => ['salutation', 'first_name', 'last_name'],
#ReadOnly => 1,
Map => [
# note: Login, Email and CustomerID needed!
# var, frontend, storage, shown, required, storage-type, http-link
[ 'UserSalutation', 'Salutation', 'salutation', 1, 0, 'var' ],
[ 'UserFirstname', 'Firstname', 'first_name', 1, 1, 'var' ],
[ 'UserLastname', 'Lastname', 'last_name', 1, 1, 'var' ],
[ 'UserLogin', 'Login', 'login', 1, 1, 'var' ],
[ 'UserPassword', 'Password', 'pw', 0, 1, 'var' ],
[ 'UserEmail', 'Email', 'email', 0, 1, 'var' ],
[ 'UserCustomerID', 'CustomerID', 'customer_id', 0, 1, 'var' ],
[ 'UserComment', 'Comment', 'comments', 1, 0, 'var' ],
[ 'ValidID', 'Valid', 'valid_id', 0, 1, 'int' ],
],
};

# CustomerUser 1
# (customer user ldap backend and settings)
$Self->{CustomerUser1} = {
	Name => 'FIRMA-LDAP',
	Module => 'Kernel::System::CustomerUser::LDAP',
	Params => {
# ldap host
	Host => 'pmdc001.domain.local',
# ldap base dn
	BaseDN => 'ou=users, ou=1001, ou=AHP Companies, dc=domain ,dc=local', 
# search scope (one|sub)
	SSCOPE => 'sub',
# The following is valid but would only be necessary if the
# anonymous user does NOT have permission to read from the LDAP tree
	UserDN => 'cn=administrator, ou=Administrators and Operators, ou=Infrastructure Objects, dc=domain, dc=local',
	UserPw => 'Kennwort',
	AlwaysFilter => '',
	SourceCharset => 'utf-8',
	DestCharset => 'iso-8859-1',
},
# customer uniq id
	CustomerKey => 'sAMAccountName',
# customer #
	CustomerID => 'mail',
#mail muss am ende stehen
#CustomerUserListFields => ['cn','sAMAccountName', 'description', 'department'],
	CustomerUserListFields => ['cn','sAMAccountName','description','mail'],
	CustomerUserSearchFields => ['cn', 'sAMAccountName', 'mail'],
	CustomerUserSearchPrefix => '',
	CustomerUserSearchSuffix => '*',
	CustomerUserSearchListLimit => 250,
	CustomerUserPostMasterSearchFields => ['mail'],
	CustomerUserNameFields => ['givenname', 'sn'],
	Map => [
# note: Login, Email and CustomerID needed!
# var, frontend, storage, shown, required, storage-type
#[ 'UserSalutation', 'Title', 'title', 1, 0, 'var' ],
	[ 'UserFirstname', 'Firstname', 'givenname', 1, 1, 'var' ],
	[ 'UserLastname', 'Lastname', 'sn', 1, 1, 'var' ],
	[ 'UserLogin', 'Login', 'sAMAccountName', 1, 1, 'var' ],
	[ 'UserEmail', 'Email', 'mail', 1, 1, 'var' ],
	[ 'UserCustomerID', 'CustomerID', 'mail', 0, 1, 'var' ],
	[ 'UserPhone', 'Phone', 'telephonenumber', 1, 0, 'var' ],
#[ 'UserAddress', 'Address', 'postaladdress', 1, 0, 'var' ],
#[ 'UserComment', 'Comment', 'description', 1, 0, 'var' ],
],
};



}

# ---------------------------------------------------- #
# 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.18 $';
$VERSION =~ s/^\$.*:\W(.*)\W.+?$/$1/;
# -----------------------------------------------------#

1;




Wo ist mein Fehler?
Was mach ich falsch?

Vielen vielen Dank im Voraus
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

OTRS an Active Directory

Post by jojo »

Die Datenbankanbidung zur OTRS Datenbank fehlt in Deiner Config.pm...
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
olafi
Znuny newbie
Posts: 4
Joined: 29 Nov 2007, 17:30

OTRS an Active Directory

Post by olafi »

Danke, dass Sie sich meine Config angesehen haben.
Leider bin ich ein blutiger Neuling in Sachen OTRS.

Mit welchen Parametern binde ich eine bzw. die Datenbank ein?
Handelt es sich dabei um die Datenbank, welche bei der
Installation erstellt worden ist?

Muss ich spezielle User anlegen?

Danke im Voraus!
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

OTRS an Active Directory

Post by jojo »

Es handelt sich um die Datenbank, die bei der Installation angelegt wurde. Bei der Installatation wird auch die Config.pm erstellt.

Beispiele für die Datenbankanbindung sind in der Defaults.pm zu finden, einfach rüberkopieren und anpassen.
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
olafi
Znuny newbie
Posts: 4
Joined: 29 Nov 2007, 17:30

OTRS an Active Directory

Post by olafi »

DANKE DANKE jetzt funktioniert die Anmeldung.
Aber ich kann mich an der customer.pl nicht anmelden.
Da bekomme ich "Panic! No User Data!!"

Wieder mal DANKE Voraus ^^
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

OTRS an Active Directory

Post by jojo »

Du musst auch ne Kundendatenbank konfigurieren, nicht nur eine Authentifizierungsquelle....
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
olafi
Znuny newbie
Posts: 4
Joined: 29 Nov 2007, 17:30

OTRS an Active Directory

Post by olafi »

Wird die Kundendatenbank hiermit nicht angesprochen?

Code: Select all


# Datenbank
# CustomerUser
# (customer user database backend and settings)
$Self->{CustomerUser} = {
Name => 'otrs',
Module => 'Kernel::System::CustomerUser::DB',
Params => { Table => 'customer_user',
},
Und dann mit den Daten aufgefüllt?
Zumindest klappt dies bei der index.pl Anmeldung....

Code: Select all

#### UserSyncLDAPMap
# (map if agent should create/synced from LDAP to DB after login)
$Self->{UserSyncLDAPMap} = {
# # DB -> LDAP
UserFirstname => 'givenName',
UserLastname => 'sn',
UserEmail => 'mail',
Phone => 'telephoneNumber',
Username => 'sAMAccountName',
comment => 'description',
};
kjack
Znuny newbie
Posts: 3
Joined: 13 Feb 2008, 11:13

OTRS an Active Directory

Post by kjack »

Hallo, ich habe leider genau das gleiche Problem und komme einfach nicht weiter. Funktioniert die Datenbankanbindung? Wenn ja, welche Parameter mussten noch geändert werden? Kann mir jemand helfen?
OTRS: 2.2.5
OS: OpenSuse 10.3
Apache2/MySQL 5
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

OTRS an Active Directory

Post by jojo »

Hallo,

für Kundendatenbank existiert kein Sync. Wenn die Kunden im LDAP sind (für die Authentifizierung) kannst Du auch das LDAP als Kundendatenbank anbinden.
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
kjack
Znuny newbie
Posts: 3
Joined: 13 Feb 2008, 11:13

OTRS an Active Directory

Post by kjack »

Danke für die schnelle Antwort.

Leider komme ich trotzdem nicht weiter. Irgendwie kapier ich nicht, mit welchen Einträgen ich den Sync herstellen kann. Wird das nicht mit dem Abschnitt UserSyncLDAPMap gemacht?

Zum besseren Verständnis (und vielleicht ist dann der Fehler klar) hier mal meine Config.pm:

Code: Select all

    # Kundenauthentifizierung
    $Self->{'Customer::AuthModule'} = 'Kernel::System::CustomerAuth::LDAP';
    $Self->{'Customer::AuthModule::LDAP::Host'} = '10.20.22.31';
    $Self->{'Customer::AuthModule::LDAP::BaseDN'} = 'DC=DOMAIN,DC=LOCAL';
    $Self->{'Customer::AuthModule::LDAP::SearchUserDN'} = 'CN=Arcserve Administrator, OU=Dienstkonten, DC=DOMAIN, DC=local',
    $Self->{'Customer::AuthModule::LDAP::SearchUserPW'} = 'geheim',
#    $Self->{'Customer::AuthModule::LDAP::AccessAttr'} = 'member';
    $Self->{'Customer::AuthModule::LDAP::UserAttr'} = 'DN';
    $Self->{'Customer::AuthModule::LDAP::UID'} = 'sAMAccountName';
    $Self->{'Customer::AuthModule::LDAP::Params'} = {
    #   port => 389,
    #   timeout => 120,
    #   async => 0,
        version => 3,
        SourceCharset => 'utf-8',
        DestCharset => 'iso8859-1',
    };

    #### UserSyncLDAPMap
    # (map if agent should create/synced from LDAP to DB after login)
    $Self->{UserSyncLDAPMap} = {
    # # DB -> LDAP
    UserFirstname => 'givenName',
    UserLastname => 'sn',
    UserEmail => 'mail',
#    Phone => 'telephoneNumber',
    Username => 'sAMAccountName',
#    comment => 'description',
    };


    # CustomerUser
    # (customer user ldap backend and settings)
    $Self->{CustomerUser} = {
#       Name => 'Firma_LDAP',
       Module => 'Kernel::System::CustomerUser::LDAP',
       Params => {
       Host => '10.20.22.31',
       BaseDN => 'DC=DOMAIN,DC=LOCAL',
       SSCOPE => 'sub',
    # The following is valid but would only be necessary if the
    # anonymous user does NOT have permission to read from the LDAP tree
       UserDN => 'CN=Arcserve Administrator, OU=Dienstkonten, DC=DOMAIN, DC=local',
       UserPW => 'geheim',
            Params => {
		port => 389,
		timeout => 120,
		async => 0,
		version => 3,
	    },
       },

       CustomerKey => 'sAMAccountName',
       CustomerID => 'mail',
       CustomerUserListFields => ['sn','cn','mail'],
       CustomerUserSearchFields => ['sAMAccountName', 'cn', 'sn', 'mail'],
       CustomerUserSearchPrefix => '',
       CustomerUserSearchSuffix => '*',
       CustomerUserSearchListLimit => 250,
       CustomerUserPostMasterSearchFields => ['mail'],
       CustomerUserNameFields => ['givenname', 'sn'],
       CustomerUserExcludePrimaryCustomerID => 0,
       AdminSetPreferences => 0,
       Map => [
    # note: Login, Email and CustomerID needed!
    # var, frontend, storage, shown, required, storage-type
    #[ 'UserSalutation', 'Title', 'title', 1, 0, 'var' ],
       [ 'UserFirstname', 'Firstname', 'cn', 1, 1, 'var', , 0 ],
       [ 'UserLastname', 'Lastname', 'sn', 1, 1, 'var', , 0 ],
       [ 'UserLogin', 'Username', 'sAMAccountName', 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 ],
       ],
    };

    }
Im Log wird angegeben, dass die "authentication ok" ist! Das verstehe wer will.

Vielleicht kann mir ja nochmal jemand auf die Sprünge helfen.

Vielen Dank schon mal im Voraus!
OTRS: 2.2.5
OS: OpenSuse 10.3
Apache2/MySQL 5
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

OTRS an Active Directory

Post by jojo »

wie ich schon schrieb:

- Du brauchst nicht nur eine Kundenauthentifizierung sondern auch Kundendaten (CustomerUser)
- Sync hat was mit Agenten zu tun, nichts mit Kunden
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
kjack
Znuny newbie
Posts: 3
Joined: 13 Feb 2008, 11:13

OTRS an Active Directory

Post by kjack »

@jojo
Vielen Dank für die Unterstützung. Nun funktioniert's endlich nach unzähligen Fehlversuchen.

Habe nun nochmals den kompletten Abschnitt "customer user ldap backend and settings" aus der Default.pm in die Config.pm kopiert und die Einstellungen angepasst und siehe da, auf einmal funktioniert es. Ich verstehe zwar immer noch nicht warum, aber vermutlich lag es doch an einem Parameter, dem ich bisher keine Beachtung geschenkt habe. Ausserdem habe ich den Sync rausgenommen, da die Agenten bei uns über die Datenbank angelegt werden.
OTRS: 2.2.5
OS: OpenSuse 10.3
Apache2/MySQL 5
Locked