Managing NerveCenter - Controlling NerveCenter from the Command Line - nccmd -
ncadmin      ncserver

nccmd

NAME

nccmd

SYNOPSIS


   nccmd [connect -s server -u userID [-p password] -n port [-f scriptFile | CLIcommand]] | [-?]

DESCRIPTION

Runs the NerveCenter command line interface (CLI). You can issue single commands, open a CLI interactive session, or run a CLI script.

OPTIONS


   connect

Connects to the specified server. Once you are connected to a server, all subsequent commands are directed to that server.


   -s server

Name of the server to which you want to connect. Required.


   -u userID

User ID under which you want to connect to the server. The default is the user ID specified during the previous connection or by the nccmd command line parameter, if any. Required.


   -p password

Password for the user ID you specified. The default is the password specified during the previous connection or by the nccmd command line parameter. -p is required for sites that use NerveCenter security.


   -n port

Number of the port you want to use for client/server communication. The default command-line-interface port is 32506. Required.


   -f scriptfile

Filename of the script or batch file containing CLI commands.

To prevent having to connect to the server explicitly each time you want to run your script, you can edit your script so that its first line is a connection command. Once you've performed this step, you can type nccmd -f scriptfile from a Windows command prompt or a UNIX shell to connect to the server and execute the commands in your script.

If any command returns an error, nccmd quits, displays the error, and returns you to the Windows command prompt or UNIX shell prompt.


   CLIcommand

Any one of several command line interface commands listed in the Command line interface reference.


   -?

Provides command-line help for the nccmd command.

Command line interface reference

You can use NerveCenter commands to control NerveCenter servers, nodes, alarms, polls, and masks from the command line interface from a scriptfile, single command, or interactive session.

The commands are generally made up of an action and an object on which you perform the action. For example, the command list mask is made up of the list action, which is performed on the mask object.

This reference consists of the following sections:

Server commands

Use these commands to list, select, disconnect from, or display information about connected NerveCenter Servers in your CLI session. These commands are listed in the order that they appear in the syntax diagram.


   serverCommand [-serverSwitch [parameter]] [-serverSwitch [parameter]]...| -?
   serverCommand

One of the several server-related keywords and their switch/parameter pairs described below. serverCommand also includes the connect command and its switch/parameter pairs described earlier.

NerveCenter directs server commands to the active server if no server is specified. The active server is the last server connected to or selected using the select server command.


   clear trigger -t triggerName [-i alarmInstanceID]

Cancels any pending triggers of a specified name that have been queued by its own alarm instance. If no alarm instance is supplied, then NerveCenter cancels the specified trigger for all alarms in which the trigger is pending.

-t triggerName

Name of the trigger to be cleared.

-i alarmInstanceID

(Optional) alarmInstanceID is a numeric value which indicates the instance of the alarm for which NerveCenter is clearing the specified trigger.


   disconnect

Disconnects from the active server.


   fire trigger -t triggerName -n nodeName | $ANY -o subobjectName | $ANY [-d delay]

Fires the specified trigger. If no delay is supplied, then NerveCenter fires the trigger immediately.

-t triggerName

Name of the trigger to be cleared.

-n nodeName | $ANY

Name of the node on which to fire the trigger or any node ($ANY).

-o subobjectName | $ANY

The name of the subobject on which the trigger is fired or any subobject ($ANY).

-d delay

(Optional) delay is a numeric value (in seconds) for NerveCenter to wait before it fires the specified trigger.


   list

Lists connected servers.


   select -s serverName

Makes serverName the active server. serverName -is one of the connected NerveCenter Servers.


   set server {-t timeoutInterval} | {-w width} | -?

timeoutInterval is the number of seconds that the CLI waits for an acknowledgement from the NerveCenter Server that a CLI request was received. The default value for timeouts is five seconds (UNIX) and one second (Windows). -t timeoutInterval is commonly used in situations where a Server is busy or the connection is slow. Should a timeout occur, connection to the Server is still maintained, but the CLI displays the message: "Error. No data was received within allowed time."

width is the character width (1-50) of columns for tabular output that the NerveCenter CLI list command displays. The default for width is 12 characters.

-? displays help for the set server commands.


   -switch parameter

One of several switch/parameter pairs described below. Parameter switches can be preceded by either a hyphen (-) or a backslash (\).


   show server -serverSwitch

Displays information about the active server.


   -serverSwitch

One of the several server-related switches described below:


   -a

Display information about the NerveCenter administrators connected to the active server.


   -c

Display information about the NerveCenter clients connected to the active server.


   -d

Display information about the NerveCenter database.


   -h

Display information about the Inform host.


   -i

Display information about the active server.


   -l

Display information about the NerveCenter license key.


   -m

Display information about the map host.


   -s

Make the specified serverName the active server. Used only with the serverCommand select.


   -?

Display help information about the specified serverCommand.

Object commands

Use these commands to delete, list, or set alarms, trap masks, nodes, and polls. These commands are listed in the order that they appear in the syntax diagram.


   {delete | list object {-switch parameter} | -? } |
   {set object {-switch parameter -w targetObject} | -? }
   delete

Deletes the specified object. One switch/parameter pair is required.


   list

Lists the specified alarm, mask, node, or poll when specified with a switch/parameter pair. When used without a switch/parameter pair, displays a list of the connected and active servers (if any).


   object

Specifies the type of NerveCenter object that you are deleting, listing, or setting attributes for. object can be: alarm, mask, node, or poll.


   -switch parameter

One of several switch/parameter pairs described below. Parameter switches can be preceded by either a hyphen (-) or a backslash (\).


   -a name | *

Identifies a specific NerveCenter alarm or poll (name) or all (*) alarms or polls. name is case-sensitive. -a does not apply to trap masks. See -m, -n, and -p.


   -a authenticationProtocol

Identifies NerveCenter nodes by their authentication protocols. Valid authenticationProtocol values are: MD5 (Message Digest algorithm) and SHA (Secure Hash Algorithm). The default protocol is MD5. For privacy, the CBC-DES protocol will be used, since this is the default provided by Envoy.


   -e on | off

Identifies NerveCenter objects by their state: enabled (on) or disabled (off).


   -g propertyGroup

Identifies NerveCenter nodes by their property group.


   -l securityLevel

Identifies NerveCenter nodes by their SNMP v3 security level. Valid securityLevel values are: NoAuthNoPriv (no authentication protocol, no privacy password), AuthNoPriv (authentication protocol, no privacy password), and AuthPriv (authentication protocol, privacy password).


   -m name | *

Identifies a specific NerveCenter trap mask (name) or all (*) trap masks. name is case-sensitive. -m only applies to trap masks. See -a, -n, and -p.


   -m yes | no

Specifies NerveCenter managed nodes (yes) or unmanaged nodes (no).


   -n name | *

Identifies a specific NerveCenter node (name) or all (*) nodes. name is case-sensitive. To display extended SNMP v3 attributes (security level, authentication protocol, and error status), use -x v3. See -a, -m, and -p.


   -p name | *

Identifies a specific NerveCenter poll (name) or all (*) polls. name is case-sensitive. See -a, -m, and -n.


   -s enterprise | node | subobject | instance

Identifies NerveCenter alarms by their scope.


   -s yes | no

Identifies NerveCenter nodes their state: suppressed (yes) or unsuppressed (no).


   -r propertyName

Identifies NerveCenter alarms or polls by their property. propertyName is case-sensitive.


   -r errorStatus

Identifies NerveCenter nodes by their error statuses. Valid errorStatus values are: AuthKeyFail, AuthPrivKeyFail, V3InitFail, ClassifyFail, TimeSyncFail


   -v SNMPVersion

Identifies NerveCenter masks, nodes, or polls by the version of the SNMP agent. Valid SNMPVersion values are: 1, 2, or 3.


   -w targetObject

Flag indicating that target object follows for the set command.

The arguments preceding the -w switch determine which attributes of an object(s) are set and what they are set to. Those that follow -w determine which object(s) are modified. For example, the sequence -r property1 -w -r property2 would change the property of all objects with property2 to property1.


   targetObject

Switch/parameter pair that identifies the NerveCenter objects whose attributes are being set.


   -x v3

Displays extended attributes of all SNMP v3 nodes. These attributes (security level, authentication protocol, and error status) are not displayed by the list node -n command.


   -?

Display help information about the delete/list/set object command.


   set

Sets attributes for the specified object. One switch/parameter pair and -w targetObject is required.

General commands

Use these commands to get command line help, quit the NerveCenter CLI, or to resync with the network management platform. These commands are listed in the order that they appear in the syntax diagram.


   -? | quit | reset alarm_instance -i instanceNumber [-s stateName] | resync
   -?

Displays help. If used without an action keyword or object, displays general information about help. If used with an action alone, gives general information about the command, including the command's syntax and the objects to which it can be applied. If used with an action and object, gives detailed information about the command's syntax.


   quit

Ends the CLI session and automatically disconnects from each connected NerveCenter Server.


   reset alarm_instance

Transitions the specified alarm to the ground state.


   -i instanceNumber [-s stateName]

Identifies the alarm to be rest to ground by a valid alarm instance number (required) and the state of the alarm (optional).


   resync

Updates the NerveCenter node list with information from the network management platform. NerveCenter automatically executes a resync at startup and when you reconnect to the platform after the connection was broken.

Notes for CLI commands

If you leave out any mandatory parameters, nccmd returns an error. In general, nccmd also returns an error if it encounters any syntax errors (for example, unknown or incorrectly specified parameters) and does not issue the command to the connected server. Specific error messages are returned by nccmd if the server encounters errors.

CLI command examples

The following command starts a CLI interactive session, connecting to the Blueridge server, with the user ID GRakauskas, and using port 32506:


   nccmd connect -s blueridge -u GRakauskas -n 32506

This command sets the property to mynodes for all alarms that are enabled:


   set alarm -r mynodes -w -e on

The command that follows assigns all nodes belonging to the troublemaker property group to the criticaldevices property group:


   set node -g criticaldevices -w -g troublemaker

In this example, all alarms set to enterprise scope are displayed:


   list alarm -s enterprise


ncadmin ncserver
29 July 2003