:::: MENU ::::

terça-feira, 14 de outubro de 2014


O OTRS é uma ferramenta de service desk, muito boa por sinal. Estou fazendo alguns testes com ela em minha rede, para substituir o GLPI. Sei que o GLPI é muito bom, mas o acho muito feio e o designer que tinha, já saiu. Então, me resta utilizar algo pronto e bonito :)
Enfim, vamos as configurações:

As configurações do OTRS devem ser feitas diretamente no arquivo Config.pm, que fica dentro do diretório /opt/otrs/Kernel, caso você instale por meio de um pacote .rpm - até recomendo, simplifica e agiliza em muito, até na hora de atualizar as versões.

Então, segue o meu arquivo de configuração:

#Enable LDAP authentication for Customers / Users
  $Self->{'Customer::AuthModule'} = 'Kernel::System::CustomerAuth::LDAP';
  $Self->{'Customer::AuthModule::LDAP::Host'} = 'winad01.linux.local';
  $Self->{'Customer::AuthModule::LDAP::BaseDN'} = 'DC=linux,DC=local';
  $Self->{'Customer::AuthModule::LDAP::UID'} = 'sAMAccountName';
  $Self->{'Customer::AuthModule::LDAP::SearchUserDN'} = 'CN=otrs,OU=services,DC=linux,DC=local';
  $Self->{'Customer::AuthModule::LDAP::SearchUserPw'} = 'SeuPassword?';
    # CustomerUser
    # (customer user ldap backend and settings)
    $Self->{CustomerUser} = {
        Name => 'LDAP Data Source',
        Module => 'Kernel::System::CustomerUser::LDAP',
        Params => {
            # ldap host
            Host => 'winad01.linux.local',
            # ldap base dn
            BaseDN => 'dc=linux, dc=local',
            # search scope (one|sub)
            SSCOPE => 'sub',
            UserDN => 'CN=otrs,OU=services,DC=linux,DC=local',
            UserPw => 'SeuPassword?',
            AlwaysFilter => '(&(objectClass=user)(objectCategory=person))',
            SourceCharset => 'utf-8',
            DestCharset   => 'utf-8',
            # Net::LDAP new params (if needed - for more info see perldoc Net::LDAP)
            Params => {
#               port => 389,
                port => 3268,
                timeout => 120,
                async => 0,
                version => 3,
            },
        },
                ReadOnly => 1,
                # customer unique id
        CustomerKey => 'sAMAccountName',
        # customer #
        CustomerID => 'mail',
        CustomerUserListFields => ['cn', 'mail'],
        CustomerUserSearchFields => ['cn', 'givenname', 'mail'],
        CustomerUserSearchPrefix => '',
        CustomerUserSearchSuffix => '*',
        CustomerUserSearchListLimit => 250,
        CustomerUserPostMasterSearchFields => ['mail'],
        CustomerUserNameFields => ['givenname', 'sn'],
        # show not own tickets in customer panel, CompanyTickets
        CustomerUserExcludePrimaryCustomerID => 0,
        # add an ldap filter for valid users (expert setting)
#       CustomerUserValidFilter => '(!(description=locked))',
        # administrator can't change customer preferences
        AdminSetPreferences => 0,
#        # cache time to live in sec. - cache any database queries
        CacheTTL => 120,
  Map => [
            # note: Login, Email and CustomerID are mandatory!
            # if you need additional attributes from AD, just map them here.
            # 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',    'sAMAccountName',             1, 1, 'var', '', 0 ],
            [ 'UserEmail',      'Email',       'mail',            1, 1, 'var', '', 0 ],
            [ 'UserCustomerID', 'CustomerID',  'sAMAccountName',            0, 1, 'var', '', 0 ],
#            [ 'UserCustomerIDs', 'CustomerIDs', 'second_customer_ids', 1, 0, 'var', '', 0 ],
            [ 'UserPhone',      'Phone',      'telephoneNumber', 1, 0, 'var', '', 0 ],
#            [ 'UserAddress',    'Address',    'postaladdress',   1, 0, 'var', '', 0 ],
#            [ 'UserComment',    'Comment',    'description',     1, 0, 'var', '', 0 ],
            [ 'UserMobile',     'Mobile',      'mobile', 1, 0, 'var', '', 0 ],
            [ 'UserRoom',       'Room',        'physicalDeliveryOfficeName', 1, 0, 'var', '', 0 ],
        ],
    };
No nosso exemplo:
linux.local: Nosso domínio
winad01.linux.local: endereço do Active Directory

Esse é exatamente meu arquivo de configuração, que autentica em um controlador de domínio Windows Server 2012 R2, que não aceita conexões anônimas por padrão.
Um detalhe que percebi é que ele se conecta a porta 3268, diferente da 389 do LDAP. A porta 3268 é a do Global Catalog Search Base. Para maiores informações, leiam aqui: http://technet.microsoft.com/en-us/library/cc978012.aspx

Até a próxima :)

Posts populares