|
|
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 8-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. Mm refers to non-keyed multiple object. |
-[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. For a list of the class names that you can use with csrc_dbtool, see Table B-1. |
Attribute | Specifies the attribute for which to search. You cannot use wild card matching to search for attributes. For more information about schema attributes, see the column AS Attribute Name in Table B-2 through Table B-32. |
Value | Specifies the value of the attribute for which to search.
|
(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 the command without any arguments. The csrc_dbtool attempts to connect to the directory through the CSRC object layer. If it is successful, it displays the csrc_dbtool help screen.
csrc_dbtool
Usage: csrc_dbtool<args> where <args> are:
-[Vv]
[file] [filename]
find -[Kk] [class] [attribute] [value]
find -[Mm] [class] [attribute] [value]
find -[Qq] [class] [filter] [sortkey]
where [Vv] refers to version number
where [Kk] refers to Unique key
where [Mm] refers to non-keyed multiple object
where [Qq] refers to non-keyed multiple object query
where [filter] should be LDAP compatible and surrounded with ()'s
where [class] should be an Application Schema class name
where [attribute] should be an Application Schema attribute name
where [sortkey] should be an Application Schema attribute
To show the csrc_dbtool version number, type the command with the -v argument.
csrc_dbtool -v Copyright (C) 1994-1999 by Cisco Systems, Inc. CSRC: version 1 CSRC_DBTool: version 1; built 07/12/99@10:56 by cgu@cgu-nt
To display the csrc_dbtool help, type:
csrc_dbtool -h Usage: csrc_dbtool<args> where <args> are: -[Vv] [file] [filename] find -[Kk] [class] [attribute] [value] find -[Mm] [class] [attribute] [value] find -[Qq] [class] [filter] [sortkey] where [Vv] refers to version number where [Kk] refers to Unique key where [Mm] refers to non-keyed multiple object where [Qq] refers to non-keyed multiple object query where [filter] should be LDAP compatible and surrounded with ()'s where [class] should be an Application Schema class name where [attribute] should be an Application Schema attribute name where [sortkey] should be an Application Schema attribute
To search for a specific entry based on a unique attribute value use the -k option. This option allows you to search for an entry in the directory using a unique key.
If you use the -k option to search for a non-unique entry, the csrc_dbtool displays the message, "It is not a unique key." You can only use the -k option to search for directory entries whose "As Unique" attributes values are true or dn. For more information about these attributes, see the "CSRC Schema" section.
csrc_dbtool find -k Account AccountName 4
csrc_dbtool find --k Lease IPAddress 192.68.2.2
To search for an entry based on attribute value use the -m option. This option allows you to search for an entry in the directory using a unique key, a wildcard, or a partial wildcard.
csrc_dbtoolfind -m Account LastName Smith
csrc_dbtoolfind -m Account AccountNumber "*"
csrc_dbtoolfind -m Account AccountNumber "4*"
csrc_dbtoolfind -m Lease IPAddress 192.68.2.2
csrc_dbtoolfind -m Lease MACAddress "*"
To search for an entry using an LDAP compatible filter, use the -q option. This option allows you to search for an entry in the directory using a unique key, wildcards, partial wildcards, or Boolean operators. You must enclose the LDAP search filter argument quotation marks, and then parenthesis, as illustrated in the examples below.
csrc_dbtoolfind -q Account "(FirstName=Peter)" AccountNumber
csrc_dbtoolfind -q Account "(LastName=S*)" AccountNumber
csrc_dbtoolfind -q Lease "(LeaseRenewalTime=Thu Sep 30 *)" ClassName
csrc_dbtoolfind -q Account "&(LastName=Smith)(AccountNumber=4)" AccountNumber
csrc_dbtoolfind -q Account "|(FirstName=Peter)(AccountNumber=4)" AccountNumber
Example 8-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 ( 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 "ldif2d," 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: Tue Sep 26 04:45:24 PDT 2000
Copyright 1989-2000©Cisco Systems Inc.