|
|
CSRC uses the LDAPv3 directory server as the default datastore for subscriber account provisioning information. This chapter explains how you can use the csrc_dbtool command to search the LDAP server for data, and add or update customer data. This chapter also includes suggestions about how you can transfer information from your billing system to the CSRC datastore.
The csrc_dbtool command is a command-line utility that you can use for the storage and retrieval of CSRC data. It does the following:
The exit status is 0 for success and non-zero for failure. The csrc_dbtool command displays error information on standard out.
The csrc_dbtool command allows you to search, import, and update the LDAP server.
The syntax is:
csrc_dbtool find -[Kk] Class Attribute Value csrc_dbtool find -[Mm] Class Attribute Value csrc_dbtool find -[Qq] Class (Filter) SortKey csrc_dbtool [file] filename
Table 7-1 lists and describes the csrc_dbtool command properties.
| Property | Description |
|---|---|
find | Specifies a search of the LDAP directory. |
-[Kk] | Searches the LDAP directory based on a unique key attribute of an application schema class in the LDAP server. |
-[Mm] | Searches the LDAP directory based on a normal attribute of application schema class in the LDAP server. Expects a set of data. |
-[Qq] | Searches the LDAP directory based on LDAP-compatible filter in the LDAP server. |
[file] | Uses an input file to add or update LDAP server. |
Class | Specifies an application schema class name. It is case sensitive |
Attribute | Specifies the attribute for which to search. You cannot use wild card matching to search for attributes. |
Value | Specifies the value of the attribute for which to search. You cannot use wild card matching to search for values. |
(Filter) | Specifies the LDAP-compatible filter. The filter supports wild card searching and requires that all expressions are enclosed in parenthesis (). |
SortKey | Specifies the sort key for which you want the results sorted and displayed. The sort key must belong to the attribute set of the class you have specified. |
filename | Specifies the filename of the text file that contains the attributes and values you want stored in the new object. |
The csrc_dbtool command requires the following files
To test whether the configuration file is correct, type:
csrc_dbtool
To show the csrc_dbtool version number, type:
csrc_dbtool -v
To display the csrc_dbtool help, type:
csrc_dbtool -h
To search all the accounts for account number is 4, type:
csrc_dbtool find -k Account AccountName 4
To search all the accounts with user's last name is "Smith," type:
csrc_dbtool find -m Account LastName Smith
To search all the accounts in which the user's last name starts with `S' and sort the display results based on AccountNumber, type:
csrc_dbtool find -q Account (LastName=S*) AccountNumber
Example 7-1 displays creating an "Account" object with the minimum required information:
[Class] Add Account [Data] AccountNumber <Insert Account Number Here> PIN <Insert PIN Here> FirstName <Insert First Name Here> LastName <Insert Last Name Here> Telephone <Insert Telephone Number Here> Address <Insert Address Here> City <Insert City Name Here> State <Insert State Name Here> ZipCode <Insert Zip Code Here> [Flush] [Class] Update Account [Data] AccountNumber <Insert Secured Account Number Here> Remove PIN <Insert Secured PIN Here> FirstName <Insert First Name Here> LastName <Insert Last Name Here> Telephone <Insert Telephone Number Here> Address <Insert Address Here> City <Insert City Name Here> State <Insert State Name Here> ZipCode <Insert Zip Code Here> [Flush]
[Class] [Data] [Flush] Add Update are keywords.
The text file you create must have the following required parts, and they must be listed in this order:
The following are keywords:
The csrc_dbtool command treats all other attributes without keywords as update operations.
To transfer the data in your company's billing system into the CSRC LDAP server, you must:
This process conveys a snap-shot of billing system accounts into the LDAP directory; you must perform this process for all future accounts.
Most billing systems are built on top of relational database systems. Using SQL commands, you can export an ASCII table of accounts, with space-separated fields. The actual commands depend on the structure of the billing database (which may require JOINS).
You need to change this tabular format (for example, using Perl) into a format that can be imported into the directory server. Many directory servers understand a data format called LDIF (which stands for LDAP Data Interchange Format). In the LDIF format, each field value of a record is placed on its own line, and records are separated by an empty line.
For example:
dn:cn=Janco Tanis,mail=janco.tanis@coas.com cn:Janco Tanis sn:Tanis givenname:Janco objectclass:top objectclass:person description: locality: st: mail:janco.tanis@coas.com title: postOfficeBox: streetaddress: postalcode: countryname: telephonenumber:800-614617 facsimiletelephonenumber: homephone:010-6916321 o:COAS xmozillanickname: xmozillausehtmlmail:FALSE xmozillauseconferenceserver:0 dn:cn=John Zulman,mail=johnz@acme.com cn:John Zulman sn:Zulman ...
The Netscape Directory Server includes a tool called "ldif2db" which imports an LDIF file into its internal database, for access by LDAP clients. You can find more information about Netscape Directory Server database management at:
http://developer.netscape.com:80/docs/manuals/directory/admin30/dbmnage.htm
![]()
![]()
![]()
![]()
![]()
![]()
![]()
Posted: Fri Oct 15 12:29:13 PDT 1999
Copyright 1989-1999©Cisco Systems Inc.