Running the CLI tool

You can execute the NSM CLI by running the /opt/IBM/tivoli/netcool/ncm/bin/nsm/nsmadmin.sh shell script with specific input options on the Netcool Configuration Manager presentation server where NSM is installed.

About this task

Each command-line tool requires a username and password of a user that has the activity Service Template Management assigned to them by the Netcool Configuration Manager administrator.

Procedure

For example, to create a NSM service template, run the /opt/IBM/tivoli/netcool/ncm/bin/nsm/nsmadmin.sh shell script by executing the following command with the correct input options:
$ /opt/IBM/tivoli/netcool/ncm/bin/nsm/nsmadmin.sh 
command=create filename=/opt/IBM/tivoli/netcool/ncm/servicetemplate_CreateZones.xml

The NSM CLI tool user will be prompted to enter a username and password of a valid NSM service designer.

The following output is an example of the output that is sent to the console for the create command:

Jul 3, 2012 1:17:06 PM com.ibm.tivoli.nsm.cli.NsmAdminCommandLineTool processCommand
INFO: Argument 1 is [command=create]
Jul 3, 2012 1:17:06 PM com.ibm.tivoli.nsm.cli.NsmAdminCommandLineTool processCommand
INFO: Argument 2 is [filename=/opt/IBM/tivoli/netcool/ncm/
servicetemplates/servicetemplate_CreateZones.xml]
Jul 3, 2012 1:17:07 PM com.ibm.tivoli.nsm.cli.NsmAdminCommandLineTool main
INFO: ServiceTemplate has returned with a HTTP Status Code of [201] ServiceTemplate Name is 
[CreateZones_J110] with a ServiceTemplate ID of [103]
Note: The arguments entered in the command-line are printed in the console output. In the case of the username and password arguments, only the keys of those parameters are printed to the screen. The values are not shown.
The nsmadmin.sh shell script checks the input options that are supplied.

If errors occur the script reports these errors and exits without submitting a request to NSM. If the input options are accepted, the request is submitted to NSM to be processed. If issues occur during processing, NSM returns the required HTTP status code and message. The HTTP status code and message include information about whether the request is received by the NSM server. The Intelliden.log file contains the NSM error code. The NSM error code contains information about issues that occurred while processing the request.

In some cases, the CLI script reports an HTTP status code that tells the NSM client user that the specific request could not be submitted because of connectivity or server issues.