Cisco Cisco Prime Network Registrar 8.3 Technical References

Page of 292
 Cisco Prime
 Network Registrar CLI Reference Guide
Using the nrcmd Program in Scripts
 
You can use the nrcmd command to interactively configure and control a Cisco  Network Registrar cluster, or you can use it as a
 programming interface for another program or script.
 
Connecting to Network Registrar
When you use the nrcmd command ,you connect to a Network Registrar cluster to read and write configuration data, read state
 data, and perform control operations.
A Network Registrar cluster consists of:
The data manager, the MCD server, which controls access to persistent datastores that contain configuration and state
 information for the DNS, DHCP, and TFTP servers.
The server agent, AIC Server Agent, which starts and stops the protocol servers, and provides a standard control interface
 to them.
The DNS, DHCP, and TFTP protocol servers.
Performing Authentication
When you log in to a cluster you are authenticated with a name and a password. The authentication protocol uses one-way hashes
 so that a password does not travel across the wire. In interactive mode, the nrcmd command prompts for a valid username and
 password. You can also provide the username or password on the command line, in the environment, or in the Windows Registry.
 (On Solaris, the Windows Registry is emulated by files in the product configuration directories.)
Because you may not want to embed the administrator password in a command script, the environment variables and registry
 entries provide alternate locations with different visibility levels. The environment variables AIC_CLUSTER, AIC_NAME, and
 AIC_PASSWORD specify the cluster, administrator name and administrator password values, respectively. These are similar to
 the same registry keys in the directory HKEY_CURRENT_USER\Software\American Internet\Network Registrar\2.0.
Choosing Scripting Techniques
Because nrcmd does a significant amount of processing at connect time, it is more efficient to perform multiple commands in a
 single session rather than to initiate a distinct connection and login for each command. The simplest way to have a single nrcmd
 session perform multiple commands is to create a batch file with one command per line and to redirect standard input from that file.
 A more complicated approach, but one that provides more control over the command sequence, is to run nrcmd from a controlling
 program and have that program send commands and read their status and output.
Using nrcmd Batch Files
The simplest way to automatically perform multiple configuration commands is to create a batch file of nrcmd commands and have
 them executed sequentially. For example, to create a scope and add reservations to it, you can enter these commands and store
 them in the file scope.txt. Lines beginning with the pound character (#) are comment lines:
# This set of commands creates a scope and adds four reservations
scope demo1 create 24.10.2.0 255.255.255.0