NetWorker: How to use the nsradmin command-line utility to manage NetWorker resources
Summary: nsradmin is a command-line utility that is provided by the NetWorker software. nsradmin can be used to modify the NetWorker server resource database (nsrdb) and the client/security database (nsrladb). This KB provides a general overview of nsradmin functionality and use cases. ...
Instructions
Overview
NetWorker resources are contained in two primary folders:
• /nsr/res/nsrdb/ - Only found on NetWorker servers. This is the NetWorker Server Resource Database.
• /nsr/res/nsrladb/ - Found on all NetWorker systems. This contains security configurations (peer certificate, and so on).
C:\Program Files\EMC NetWorker\nsr\res."
nsradmin allows you to change, create, or delete resources from the nsrdb and nsrladb database. In order to ensure security and prevent unwanted tampering, a root or Administrator command prompt must be used. If the system user is restricted from using root or Admin command prompt, the nsrlogin command can be used. nsrlogin authenticates using accounts that are configured (either local or external) in the NetWorker authentication service. nsrlogin issues a time-based token which allows the user (if permitted) to make changes through nsradmin and use other elevated NetWorker commands:
- Local user account:
nsrlogin -u username - External authentication (AD/LDAP):
nsrlogin -t tenant_name -d domain_name -u user_name - Log out: nsrlogout
Accessing nsradmin
To list all the attributes for a specific NetWorker resource, such as a client.
You can use the tool online or offline, but if you change the nsrdb or nsrladb offline, you must restart the NetWorker service to apply them.
nsradmin interacts with NetWorker daemons running on an online server in order to view or change resource attributes.
nsradmin
nsradmin attempts to open a connection to the nsrdb. To access the nsrladb, you must specify the client process (nsrexec).
nsradmin -p nsrexecd
nsradmin is pointed to the relevant resource database in order to view or change resource attributes.
nsradmin -d /path_to/nsrdb
-s switch to run nsradmin on a remote NetWorker system to connect to nsradmin on another NetWorker system over the network.
nsradmin -s remote_networker_system [-p nsrexecd]
Input File: Takes input commands from a file instead of from standard input. In this mode, the interactive prompt is not printed.
nsradmin -i fileOther functions and operations are detailed in the
nsradmin section of the NetWorker Command Reference Guide, available through: https://www.dell.com/support/product-details/product/networker/docs
Logging
Changes to the nsrdb that are performed through nsradmin are logged in the NetWorker server's /nsr/logs/rap.log (default: C:\Program Files\EMC NetWorker\nsr\logs\rap.log on Windows operating systems)
Using nsradmin
nsradmin modes
nsradmin can be used in two modes:
- Command-mode (default) and visual-mode; Command-mode is the common method used to view and operate
nsradmin. No additional options are required to use this mode. - Visual-mode provides a fullscreen command-line interface which can be used to view and manage the NetWorker resources. This method may be useful when specific resources or attributes: values are unknow; however, it is limited in batch processing operations. To enter visual-mode, enter
visualat thensradminprompt:
[root@nsr ~]# nsradmin NetWorker administration program. Use the "help" command for help, "visual" for full-screen mode. nsradmin> visual
NetWorker resource types
To get a list of known resource types. Enter type at the nsradmin prompt. Example from a NetWorker server:
nsradmin> type Known types: NSR, NSR auditlog, NSR client, NSR client fix, NSR cloneconfig, NSR Data Domain, NSR device, NSR directive, NSR hypervisor, NSR label, NSR license, NSR lockbox, NSR NAS discovery task, NSR notification, NSR policy, NSR pool, NSR Protection Group, NSR Protection Policy, NSR recover, NSR Rule, NSR savesets count, NSR SCG, NSR schedule, NSR service, NSR stage, NSR Storage Node, NSR task, NSR usergroup, NSR VMware proxy, NSR vproxy log aggregate;
Operations within nsradmin are as follows:
bind [query]
create attrlist
delete [query]
edit [query]
help [command]
print [query] (set current query)
server [name]
show [attrlist]
types
update attrlist
append attrlist
quit
visual [query]
option [list]
unset [list]
. [query]
? [command]
exit
Where:
query ::= attrlist
attrlist ::= attribute [; attribute]*
attribute ::= name [: [value [, value]* ]
Querying NetWorker resources
nsradmin prompt:
nsradmin> print type:NetWorker_resource; attribute:value
For example, to query all the attributes for a NetWorker client resource that is named Pluto, type the following:
nsradmin> print type: NSR client; name: win-srvr01.amer.lan
Listing and filtering nsradmin results
nsradmin prompt:
nsradmin> . type: NSR client; name: client_name nsradmin> show nsradmin> print
To list all clients in a particular protection group, enter the following command at the nsradmin prompt:
nsradmin> . type: nsr client; protection group list:Protection_Group_Name nsradmin> show name nsradmin> print
To print a listing of all registered clients and their operating systems, enter the following command at the nsradmin prompt:
nsradmin> . type: NSR client nsradmin> show name; OS nsradmin> print
To list all devices that are in service mode, enter the following command at the nsradmin prompt:
nsradmin> show name nsradmin> print type: NSR device; enabled: Service
Hidden options can be displayed by entering the following before querying any resource type:
nsradmin> option hidden
To reset the query specifications set by entering show attribute, enter show:
nsradmin> show
Updating resources
nsradmin prompt:
nsradmin>. type:NetWorker_resource; attribute:value nsradmin> update action; attribute1:value; attribute2:valueYou can update multiple attributes for a resource. Attribute: value combinations are separated by a semicolon (;). For example, to modify the save set and backup command that is used by a client:
nsradmin> . type: nsr client; name: win-srvr01.amer.local nsradmin> update save set:"MSSQL:DELL"; backup command:nsrsqlsv
Deleting Resources
nsradmin online-mode is used. It is a good idea to create a backup of the /nsr/res/nsrdb (server) and /nsr/res/nsrladb (client) before changing these databases.
To delete any resource, enter delete after setting the resource type; for example:
nsradmin> . type: NetWorker_Resource; attribute:value nsradmin> delete
Example:
nsradmin> delete type: nsr pool; name: DD_Bootstrap name: DD_Bootstrap; Delete? yes delete failed: Pool `DD_Bootstrap' cannot be deleted because it has active volumes in the media database.
nsradmin in offline mode; however, this deletes a resource regardless if dependencies are resolved. Once services on the server are restarted, the deleted resource will no longer appear.
Creating Resources
nsradmin> create type: Networker_resource; name:resource_name; attribute1:value; attribute2:value create? yes