Total Pageviews

Wednesday, November 19, 2014

ldapmodify not working, command mistakes

when you are running an ldif file with a lot of attributes to load into OID and getting error don't know what the reason is. please check space between each  record you are trying to import and definition of each record.

for example you are adding attributes to OID with below ldif file

Wrong Formate

dn: cn=subSchemaSubentry
changetype: modify
add: attributetypes
attributetypes: ( 2.16.840.1.113894.9999.1.24 NAME 'tAuthenticateUser' DESC
 'Authenticate User Flag' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE
  USAGE userApplications )


attributetypes: ( 2.16.840.1.113894.9999.1.25 NAME 'tAuthenticateCaller' DES
 C 'Authenticate Caller Flag' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-V
 ALUE USAGE userApplications )

attributetypes: ( 2.16.840.1.113894.9999.1.26 NAME 'tOneTimeTokenFlag' DESC
 'One Time Token Flag' EQUALITY caseExactMatch SYNTAX '1.3.6.1.4.1.1466.115.1
 21.1.15' SINGLE-VALUE USAGE userApplications )



attributetypes: ( 2.16.840.1.113894.9999.1.27 NAME 'tIPCheckFlag' DESC 'IP C
 heck Required Flag' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE USAG
 E userApplications )


and run below command
./ldapmodify -h qatovdx.unix.gsm.org -p 389 -D cn=orcladmin -w yourpassword  -v -f  /tmp/oid/tattributes_withspace.ldif
ldapmodify: no attributes to change or add (entry cn=subschemasubentry )
the issue is, each attribute need to have complete command and second and commonly over looked mistake is there is space between attribute command and attribute definition. so the command should be like this.
CORRECT FILE forate
dn: cn=subSchemaSubentry
changetype: modify
add: attributetypes
attributetypes: ( 2.16.840.1.113894.9999.1.24 NAME 'tAuthenticateUser' DESC
 'Authenticate User Flag' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE
  USAGE userApplications )

dn: cn=subSchemaSubentry
changetype: modify
add: attributetypes

attributetypes: ( 2.16.840.1.113894.9999.1.25 NAME 'tAuthenticateCaller' DES
 C 'Authenticate Caller Flag' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-V
 ALUE USAGE userApplications )

dn: cn=subSchemaSubentry
changetype: modify
add: attributetypes 

attributetypes: ( 2.16.840.1.113894.9999.1.26 NAME 'tOneTimeTokenFlag' DESC
 'One Time Token Flag' EQUALITY caseExactMatch SYNTAX '1.3.6.1.4.1.1466.115.1
 21.1.15' SINGLE-VALUE USAGE userApplications )

dn: cn=subSchemaSubentry
changetype: modify
add: attributetypes 

attributetypes: ( 2.16.840.1.113894.9999.1.27 NAME 'tIPCheckFlag' DESC 'IP C
 heck Required Flag' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' SINGLE-VALUE USAG
 E userApplications )

No comments:

Post a Comment