Submitting a NSM service template for execution

To submit a NSM service template so that it can be executed, the NSM client user must ensure that the NSM service template ID and the ID of the device that the service is executed on are supplied. The NSM service template might also include a list of client parameters that are supplied by the client to ensure that the service executes properly.

Before you begin

Important: When dealing with different types of operation within a single service template, multiple UOWs will be created, and the execution order of those UOWs cannot be guaranteed. In order to guarantee the expected UOW execution order in this situation, separate NSM services should be created and invoked in the desired order.

About this task

In the following procedure, the NSM service template that is being submitted and executed creates zones for a firewall.

Procedure

  1. As the NSM client user, request the details of the NSM service template to execute by running the /servicetemplate/{servicetemplate-id}/deviceid/{device-id} URI using the GET method.

    The latest version of the required NSM service template that matches the NSM service template ID and device ID entered is returned.

  2. The NSM client user should populate any required client parameter values. The following XML is a sample of a NSM service template that is ready to be executed after the NSM client user has populated the values for the client parameters.
    <serviceTemplate serviceTemplateId="123">
    	<deviceID>4</deviceID>
    	<clientParameters>
    		<clientParameter>
    			<name>ZONE_NAME</name>
    			<value>Cisco_Zone_Name</value>
    		</clientParameter>
    		<clientParameter>
    			<name>SOURCEROUTETABLE</name>
    			<value>CISCO_SRT</value>
    		</clientParameter>
    		<clientParameter>
    			<name>TARGETROUTETABLE</name>
    			<value>CISCO_TRT</value>
    		</clientParameter>
    		<clientParameter>
    			<name>VIRTUALROUTERNAME</name>
    			<value>CISCO_VRN</value>
    		</clientParameter>
    	</clientParameters>
    </serviceTemplate>

    The following XML is a sample of a NSM service template that is ready to be executed using the clientParameterList element to enable multiple execution of the same operation in a single request.

    <serviceTemplate serviceTemplateId="123">
    <deviceID>4</deviceID>
    <clientParameterLists>
    <clientParameterList name="ZONE_NAME_ID">
    <parameter name="ZONE_NAME">
    <values>
    <value order="1">Cisco_Zone_Name1</value>
    <value order="2">Cisco_Zone_Name2</value>
    	</values>
    	</parameter> 
    	<parameter name="SOURCEROUTETABLE">
    	<values>
    	<value order="1">CISCO_SRT_1</value>
    	<value order="2">CISCO_SRT_2</value>
    	</values>
    	</parameter> 
    	<parameter name="TARGETROUTETABLE">
    	<values>
    	<value order="1">CISCO_TRT_1</value>
    	<value order="2">CISCO_TRT_2</value>
    	</values>
    	</parameter>  
    	</clientParameterList> 
    	<clientParameterLists>
    	</serviceTemplate>

    By supplying a third value to each <parameter> tag the service will be executed a third time for that operation request.

    Note: You can combine both <clientParameterList> and <clientParameters> in the same NSM service template for service execution.
  3. As the NSM client user, submit the NSM service template XML from step 2 so it can be executed by running the /service URI using the POST method.
    The following is a sample of the response that is returned for the NSM service template submitted.
    <service id="4" createdByUser="administrator" createDate="2012-07-18 12:52:38.744 GMT+00:00">
    	<status>Submitted</status>
    	<devices>
    		<device>
    			<id>4</id>
    		</device>
    	</devices>
    	<appliedServiceTemplates>
    		<serviceTemplate version="1" serviceTemplateId="123"/>
    	</appliedServiceTemplates>
    When the service is submitted, it is processed by the NSM service execution engine. If the execution processing succeeds, work item entries are submitted to Netcool Configuration Manager so that it can complete the operations that the service requires. The service content is updated with serviceWorkItem entries that identify the work item entries in Netcool Configuration Manager for the service.
  4. Check the status of the work item that is submitted to Netcool Configuration Manager for processing updates by running the /service/{service-id} URI using the GET method. Enter the service ID that is returned in the sample response in the previous step.
    This URI returns the information about the work items.
  5. If the work item status is Success, it means that the service executed successfully. If the work item status is Failed, it means that the service failed to execute.

    Complete the following steps to examine the result and log content for a successful or failed service execution.

    1. Check the success or failure by running the /service/{service-id}/workitem URI using the GET method.

      A list of work items for the service with information about them is returned.

    2. Identify the work item you want to investigate by running the /service/{service-id}/workitem/{workitem-id} URI with the specific work item ID and the GET method.

      Information about the work item status, the result content, and the log content is returned. Depending on the type of work item, the result content varies. For example, when a work item is for an operation whose type is EXTRACTION, the result content includes the result of the extraction.

      See Netcool Configuration Manager documentation for more information about troubleshooting Netcool Configuration Manager work item failures.

  6. If further information is needed then review the service logs for NSM services on the Netcool Configuration Manager user interface. NSM services are listed as entries in the Queue Manager of the Netcool Configuration Manager GUI. Each service has a service log that can be opened to display some information about the execution of the service. The log contains information about the service execution and any child UOWs that were created as part of the execution of the service. Information relating to the failure of a service's exection may also be found in this log.