![]() |
Configuration,
Command, and File Reference Netscape Directory Server |
| Previous |
Contents |
Index |
DocHome | Next |
This chapter provides information on the scripts you can use to manage your directory, such as backing-up and restoring your database. Scripts are a shortcut way of executing the ns-slapd interface commands that are documented in Appendix A, "Using the ns-slapd and slapd.exe Command-Line Utilities."
This chapter contains the following sections:
By default all scripts are stored in the following directory:
Be sure to refer to Command-Line Scripts Quick Reference for the exact location of each script.
When scripts request either a directory name or a file name, always provide the absolute path. The scripts assume that you want to use the dse.ldif file located in this directory:
serverRoot/slapd-serverID/config
|
|
|
|
In order to execute the Perl scripts, you must change to the directory where the scripts are stored. Although it is possible to set command-path and library-path variables to execute the scripts, it is not recommended because you run the risk, particularly when you have more than one server version installed, of disrupting the correct execution of other utilities. There's also the risk of compromising the security of the system. (The same procedure also applies to the command-line utilities discussed in chapter 7, "Command-Line Utilities.") Also, when you are running the Perl scripts on Windows machines, you must make sure that the path environment variable contains the Perl executable (perl.exe) file. For this reason, make sure to run the scripts from the following directory on these machines: serverRoot\bin\slapd\admin\bin
|
|
|
|
|
This section covers the following scripts:
Some of the shell and batch scripts can be executed while the server is running. For others, the server must be stopped. The description of each script below indicates whether the server must be stopped or if it can continue to run while you execute the script.
When a shell or batch script has a Perl
equivalent, there is a cross-reference to the section describing the
equivalent Perl script.
|
|
|
|
When using the batch scripts on Windows, the
-s
option may not function correctly because of a bug in the Windows
command-line interpreter. The command-line interpreter removes the
double quotes and treats values as separate in some cases.
|
|
|
|
|
Restores the database from the most recent archived backup. To run this script, the server must be stopped.
For information on the equivalent Perl script, see bak2db.pl (Restore database from backup). For more information on restoring databases, see chapter 4, "Populating Directory Databases," in the Netscape Directory Server Administrator's Guide.
Creates a backup of the current database contents. This script can be executed while the server is still running.
For information on the equivalent Perl script, refer to db2bak.pl (Create backup of database).
Exports the contents of the database to LDIF. This script can be executed while the server is still running.
For information on the equivalent Perl script, see db2ldif.pl (Export database contents to LDIF).
For the shell and batch scripts, the script runs the slapd (Windows) or ns-slapd (UNIX) command-line utility with the ldif2db keyword.
You must specify either the -n or the -s option. By default, the output LDIF will be stored in one file. Should you want to specify the use of several files, then use the option -M.
Exports the contents of the database to DSML version 1.0. This script can be executed while the server is still running.
Reindexes the database index files.
For information on the equivalent Perl script, see db2index.pl (Create and generate indexes).
Here are a few sample commands:
Imports the contents of the DSML version 1.0 document into the database. To run this script, the server must be stopped.
Prints the encrypted form of a password using one of the server's encryption algorithms. If a user cannot log in, you can use this script to compare the user's password to the password stored in the directory.
There are no options for this script.
For more information on the different storage schemes, such as SSHA, SHA, CRYPT, and CLEAR, see the Netscape Directory Server Administrator's Guide.
Runs the slapd (Windows) or ns-slapd (Unix) command-line utility with the ldif2db keyword. To run this script, the server must be stopped.
For information on the equivalent Perl
script, refer to ldif2db.pl
(Import).
|
|
|
|
ldif2db supports LDIF version 1 specifications. You can load an attribute using the :< URL specifier notation; for example: jpegphoto:< file:///tmp/myphoto.jpg Although the official notation requires three ///, the use of one / is tolerated. For further information on the LDIF format, see chapter 4, "Managing Directory Entries," in the Netscape Directory Server Administrator's Guide.
|
|
|
|
|
Performs an import operation over LDAP to the Directory Server. To run this script, the server must be running.
Retrieves performance monitoring information using the ldapsearch command-line utility.
There are no options for this script.
For more information on the ldapsearch command-line utility, see section ldif in chapter 7.
Restores, by default, the most recently saved Administration Server configuration information to the NetscapeRoot partition under the following directory:
Saves Administration Server configuration information to the following directory:
Starts the Directory Server. It might be a good idea to check whether the server has been effectively started using the ps command because it could sometimes be that the script returned while the startup process was still on-going, resulting in a confusing message.
Stops the Directory Server. It might be a good idea to check whether the server has been effectively stopped using the ps command because it could sometimes be that the script returned while the shutdown process was still on-going, resulting in a confusing message.
To run the vlvindex script, the server must be stopped. The vlvindex script creates virtual list view (VLV) indexes, known in the Directory Server Console as browsing indexes. VLV indexes introduce flexibility in the way you view search results. Using VLV indexes, you can organize search results alphabetically or in reverse alphabetical order, and you can scroll through the list of results. VLV index configuration must already exist prior to running this script.
You must specify either the -n or the -s option.
|
Specifies the debug level to use during index creation. Debug levels are defined in nsslapd-errorlog-level (Error Log Level). |
||
|
Specifies the server configuration directory that contains the configuration information for the index creation process. You must specify the full path to the slapd-serverID directory. |
||
|
VLV index identifier to use to create VLV indexes. You can use the console to specify VLV index identifier for each database supporting your directory tree, as described in the NNetscape Directory Server Administrator's Guide. You can define additional VLV tags by creating them in LDIF and adding them to Directory Server's configuration, as described in the Netscape Directory Server Administrator's Guide. In any case, we recommend you use the DN of the entry for which you want to accelerate the search sorting. |
This section covers the following scripts:
Restores a database from a backup.
The script bak2db.pl creates an entry in the directory that launches this dynamic task. The entry is generated based upon the values you provide for each option.
Creates a backup of the database.
The script db2bak.pl creates an entry in the directory that launches this dynamic task. The entry is generated based upon the values you provide for each option. Currently, the only possible database type is ldbm.
Creates and generates the new set of indexes to be maintained following the modification of indexing entries in the cn=config configuration file.
The script db2index.pl creates an entry in the directory that launches this dynamic task. The entry is generated based upon the values you provide for each option.
Exports the contents of the database to LDIF. This script creates an entry in the directory that launches this dynamic task. The entry is generated based upon the values you provide for each option. The * indicates that multiple occurrences are allowed.
To run this script, the server must be running, and either -n backend_instance or -s includesuffix is required.
This Perl script db2ldif.pl creates an entry in the directory that launches this dynamic task. The entry is generated based upon the values you provide for each option.
To run this script, the server must be running. The script creates an entry in the directory that launches this dynamic task. The entry is generated based upon the values you provide for each option.
Analyzes the access logs of a Directory Server to extract usage statistics and count the occurrences of significant events. It is compatible with log formats from previous releases of Directory Server. For information on access logs, see chapter 5, "Access Log and Connection Code Reference."
The tool will extract the following information from access logs:
The logconv.pl tool displays two types of statistics useful for monitoring and optimizing directory usage:
Some information that is extracted by the logconv.pl script is available only in logs from current releases of Directory Server; the corresponding values will be zero when analyzing logs from older versions. In addition, some information will only be present in the logs if verbose logging is enabled in your Directory Server. For more information, see nsslapd-accesslog-level.
The following issues will affect the output and performance of this tool:
If you customize the logconv.pl script for added functionality, we encourage you to share your work with other LDAP users. Please post a message to the netscape.dev.directory public newsgroup with your ideas or your code.
The logconv.pl -h command will display the usage help text that briefly describes all options.
The logconv.pl command-line options are described in the following table.
The parameters without a preceding dash ( - ) at the end of the table will enable the optional lists of occurrences. Specify only those you need to limit the output and improve execution speed. You may specify any number of these parameters in any order, but they must all be given together as a single option on the command-line; for example: -abcefg.
Regardless of the order of options on the command-line, the lists will appear in the output in the order they are listed in this table. Use the -V option to display all optional output. Also, use the -s number option to control the length of these lists.
The migrateInstance7 script (this is a Perl script despite the fact that it does not have the .pl extension) migrates an instance of previous releases of Directory Server to Directory Server 7.x.
When you run this script, it migrates the configuration files or configuration entries, database instances, and schema with minimum manual intervention. The migrateInstance7 script calls on the migrate6To7 script, which then executes the migration.
For complete information on the configuration parameters and attributes that are migrated, refer to chapter 6, "Migration from Earlier Versions." For migration procedure, refer to the Netscape Directory Server Installation Guide.
Before performing the migration, check that the user-defined variables contain the following associated values, where server7Root is the path to where Netscape Directory Server 7.x is installed:
Provides account status information to establish whether an entry or group of entries is inactivated.
Activates an entry or group of entries.
Inactivates and thus locks an entry or group of entries.
Adds entries required for implementing the user- and subtree-level password policy. For an overview of user- and subtree-level password policy, check the Netscape Directory Server Deployment Guide. For instructions to enable this feature, check the Netscape Directory Server Administrator's Guide.
Troubleshoots replication-related problems.
In the absence of the -i option, the script must be run when the Directory Server is running and from a location from which the server's change-log directory is accessible.
Shows in-progress status of replication.
|
Specifies the initial replication supplier's host. The default value is the current hostname. |
||
|
Specifies the initial replication supplier's port. The default value is 389. |
||
|
Specifies the absolute path to the configuration file, which defines the connection parameters used to connect to LDAP servers to get replication information. For more information about the configuration file, see Configuration File Format that follows this table. |
||
|
The output HTML file may invoke a CGI program periodically. If this CGI program in turn calls this script, the effect is that the output HTML file would automatically refresh itself. This is useful for continuous monitoring. See also the -t option. The script has been integrated into Netscape Administration Express, enabling you to monitor replication status via that interface. |
||
|
Specifies the refresh interval in seconds. The default value is 300 seconds. This option must be jointly used with the -u option. |
||
|
If specified, the -r option causes the routine to be entered without printing the HTML header information. This is suitable when making multiple calls to this routine (for example, when specifying multiple, different, "unrelated" supplier servers) and expecting a single HTML output. |
||
The configuration file defines the following:
The format for the configuration file is shown below.
|
[connection] |
In the connection section, you specify how this tool may connect to each LDAP server in your replication topology to get the replication-agreement information. The default binddn is cn=Directory Manager . Simple bind will be used unless bindcert is specified with the path of a certificate database.
A server may have a dedicated or shared entry in the connection section. The script will find out the most matched entry for a given server. For example, if all the LDAP servers except host1 share the same binddn and bindpassword, the connection section will need to contain just two entries:
*:*:binddn:bindpassword:
host1:*:binddn1:bindpassword1:
In the optional alias section, you may use aliases such as Supplier1, Supplier2, Hub1, and so on, to identify the servers in the replication topology. If used, the output will show these aliases, instead of http(s)://hostname:port.
You may also choose to display CSN time lags between suppliers and consumers in different colors based on their range. The default color set is green for 0-5 minutes lag, yellow for 5-60 minutes lag, and pink for a lag of 60 minutes or more.
The connection parameters for all the servers in a replication topology must be specified within one configuration file. One configuration file, however, may contain information for multiple replication topology.
Because of the connection parameters, the replication monitoring tool does not need to do DES decryption of the credentials stored in the Directory Server. Each line in this file could either be a comment started with the # character or a connection entry of the format:
host:port:binddn:bindpwd:bindcert
For example, your configuration file may look like the example shown below.
|
#Configuration
File for Monitoring Replication Via Admin Express [alias] [color] |
| Previous |
Contents |
Index |
DocHome | Next |