NSRADMIN(8)

NAME

nsradmin - NetWorker administrative program

SYNOPSIS

nsradmin [ -c ] [ -i file ] [ -s server ] [ -p prognum ] [ -v version ] [ query ]

nsradmin [ -c ] [ -i file ] [ -f resfile ... ] [ -t typefile ] [ query ]

DESCRIPTION
The nsradmin command is a command-line based administrative program for the NetWorker system. Normally nsradmin monitors and modifies NetWorker resources over the network. Commands are entered on standard input, and output is produced on standard output.

If nsradmin is started without a query it uses a default query that selects all resources involved in NetWorker products.

OPTIONS

-c  Uses the termcap(5) and curses(3) packages to implement a full-screen display mode, just like the visual command described below.

-f resfile
    Uses the NetWorker resource file resfile instead of opening a network connection. This should be used sparingly, and only when the NetWorker server is not running. Multiple -f and resfile arguments can be used to start nsradmin with access to more than one file at a time.

-i file
    Takes input commands from file instead of from standard input. In this mode, the interactive prompt will not be printed.

-s server
    Opens a connection to the named NetWorker server instead of allowing administration of all servers. Useful to limit the number of resources if there are many servers, or to administer when the RAP location service is not working.

-p program
    Uses the given RPC program number instead of the standard program number. The standard number is 390109. This option is generally used only for debugging.

-t typefile
    Uses the alternate file typefile to define RAP types.

-v version
    Binds to the NetWorker RAP service with the given version number. The default is 2. This option is generally used only for debugging.

query
    If a query is specified (in the form of an attribute list), the edit operation is performed on the results of the query. See COMMANDS for more information on how the edit command works.

RESOURCES

Each NetWorker resource is made up of a list of named attributes. Each attribute can have zero or more values. The attribute names and values are all represented by printable strings. Upper and lower case is not distinguished on comparisons, and spaces are ignored except inside the names and values.

The format for specifying attributes and attribute lists is:

attribute ::=  name [ : value [ , value ]* ]
    An attribute is a name optionally followed by a colon, followed by zero or more values, with values separated by commas. A comma at the end of a line continues the line.

attribute list ::= attribute [ ; attribute ]*
    An attribute list is one or more attributes separated by semicolons. A semicolon at the end of a line continues the line. The list is ended by a newline that is not preceded by a comma or semi-colon.

Here is an example of an attribute list:

    name: mars;
    type: NSR client;
    remote access: mars, venus, jupiter;

For more information on attributes, attribute lists and the NetWorker resource types, see the resource(5), nsr_resource(5), and rap(8) manual pages.

COMMANDS
At each input prompt, nsradmin expects a command name and some optional arguments. Command names can be shortened to the smallest unique string (for example, p for print). Command arguments are always specified in the form of an attribute list. Most commands operate on a set of resources returned by a query. The query is specified as an attribute list which is used to match resources with the following rules:

    1) The resource must match all the given attributes.

    2) If more than one value is specified the resource can match any one of the values.

    3) Values in a query may be in the form of ed(1) style regular expressions. A pattern match is attempted against all resources that contain the specified attribute.

    4) If an attribute is specified with no value the resource must contain an attribute of that name.

Thus, a query:
    type:NSR device;
    name:mars, venus;
    test
will match all resources that have a type attribute with the value NSR device and a name attribute with a value of either mars or venus, and an attribute test with any value.

If the query has only one name and no values (for example, if there is no semi-colon or colon in it), then the program tries to guess a more reasonable query. If the name is a host name, then the query will select all the resources on the given host. Otherwise, the name will be interpreted as a type name, and all resources of that given type will be selected.

bind [query]
    Bind to the service that owns the resource described by query. If no query is specified, queries are sent to the RAP Resource Directory, and update, create, and delete commands to the service that owns the resource being changed. On failure, the previous service will continue to be used.

create attribute list
    Create a resource with the given attributes. One of the attributes must be type to specify a NetWorker type that can be created. The types command can be used to find out which NetWorker types a server supports.

delete [query]
    Delete the resources that match the current query. If a query is specified, it becomes the current query.

edit [query]
    Edit the resources that match the current query. If a query is specified, it becomes the current query. If the environment variable EDITOR is set, then that editor will be invoked, otherwise vi(1) will be started. When the editor exits, nsradmin applies update, delete and create operations based on the changes to the resources. Be careful to not edit the resource identifier attribute, and to write the file out before exiting the editor.

help [command]
    Print a message describing a command. If no command name is given a synopsis of all of the commands is printed.

option [list]
    This command enables some options to change the display of resources. With no arguments it displays the current options; with a list of options it turns the specified ones on. The options are: Dynamic displays all dynamic attributes, even the normally hidden ones. Hidden displays all attributes, even the normally hidden ones. Resource ID displays the resource identifier on each resource, a number that is used internally to provide sequencing and uniqueness.

print [query]
    Print the resources that match the current query. If a query is specified, it becomes the current query. If a name has been specified for the the current show list, only the attributes for the specified name in the show list will be displayed.

quit
    Exits nsradmin.

server [servername]
    Bind to the given NetWorker server name. If no server is specified, the RAP location service will be used. On failure, the previous server will continue to be used.

show [name; ...]
    If a name list (really an attribute list with no values) is specified, add those names to the show list. Only these attributes will be displayed in subsequent print commands. If no name list is given the show list is cleared, resulting in all attributes being shown.

types
    Print a list of all known types.

unset [list]
    This command turns off the specified option.

update attributes
    Update the resources given by the current query to match attributes.

visual  [query]
    Enter a full-screen mode using the curses(3) package to step through commands in a perhaps more user-friendly manner than the command line interface. You can get this mode directly using the -c command line argument.

. [query]
    If a query is specified, this command will set the current query without printing the results of the query. Otherwise, it will display the current query, show list, server binding, and options.

? [command]
    Same as the help command above.

EXAMPLES

print type:NSR device
    Print all resources of type NSR device and make this the current query.

show type; name
    Set the show list to display only the attributes type and name.

delete
    Delete all resources that match the current query.

delete type:NSR device; hostname: mars
    Delete the resource with attributes: type: NSR device and hostname: mars.

edit type:NSR notification
    Edit all resources of type NSR notification.

SEE ALSO
ed(1), vi(1), curses(3), nsr_resource(5), termcap(5), nsr(8) rap(8).

DIAGNOSTICS

The following exit status values are meaningful:

0   Interactive mode exited normally.

1   There was a usage or other non-query related error.

2   When reading input from a file (-i file), one or more RAP operations failed. This status is never returned interactively.