Highlighted
Trusted Contributor.
Trusted Contributor.
364 views

Incident "Assigned To" as variable in Actions

Jump to solution

Hi all,

NNMi v10.x. Unable to find any parameter string for the Assigned To field in an incident. Any suggestions to how the Assgined To information can be passed on to an incident action script? If at all possible?

tsorheim

0 Likes
1 Solution

Accepted Solutions
Highlighted
Acclaimed Contributor.. Acclaimed Contributor..
Acclaimed Contributor..

Re: Incident "Assigned To" as variable in Actions

Jump to solution

Hello tsorheim,

 

Web services are already there, so nothing to enable. Best practice is to define a local user in NNMi with the role "web service client" as you must authenticate the request. A curl call looks like this:

 

curl --user "webserviceclientuser:pwdofuser" --header "content-type: text/xml; charset=utf-8"  --data @/tmp/nnmi_soap_req.xml --output /tmp/nnmi_soap_result.xml -X POST http://<nnmi-server>:<port>/NodeBeanService/NodeBean

The nnmi_soap_req.xml contains the request and output is written to nnm_soap_result.xml. As far as I remember curl has switch for https, too (if you use this).

 

Just another hint: you can add this subfilter below the end of the other subfilter to see the custom incident attributes in the result, too:

 

<subFilters xsi:type="ns3:constraint">

   <name>includeCias</name>

   <value>true</value>

</subFilters>

 

HTH and kind regards

 

Allessandro

View solution in original post

4 Replies
Highlighted
Acclaimed Contributor.. Acclaimed Contributor..
Acclaimed Contributor..

Re: Incident "Assigned To" as variable in Actions

Jump to solution

Hello tsorheim,

 

I have checked the possible variables for actions in the online help and cannot find a variable for assignedTo, too.

 

So you have to get the assignedTo in the action script. I would use NNMI Web Service Incident Bean:

 

http://<nnmi-server>:<port>/IncidentBeanService/IncidentBean

Request:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:inc="http://incident.sdk.nms.ov.hp.com/">
   <soapenv:Header/>
   <soapenv:Body>
     <inc:getIncidents>
         <arg0 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns:ns3="http://filter.sdk.nms.ov.hp.com/"
         xsi:type="ns3:expression">
             <operator>AND</operator>
         <subFilters xsi:type="ns3:condition">
               <name>id</name>
               <operator>EQ</operator>
               <value>23622321800</value>
         </subFilters>
         </arg0>
     </inc:getIncidents>
   </soapenv:Body>
</soapenv:Envelope>

 

Result:

 

<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
   <env:Header/>
   <env:Body>
      <inc:getIncidentsResponse xmlns:inc="http://incident.sdk.nms.ov.hp.com/">
         <return>
            <item>
               <assignedTo>asoloperto</assignedTo>
               <category>com.hp.nms.incident.category.Fault</category>
               <created>2017-08-10T16:27:11.632+02:00</created>
               <duplicateCount>0</duplicateCount>
               <family>com.hp.nms.incident.family.Node</family>
               <firstOccurrenceTime>2017-08-10T16:27:11.546+02:00</firstOccurrenceTime>
               <formattedMessage>Node Down</formattedMessage>
               <id>23622321800</id>
               <lastOccurrenceTime>2017-08-10T16:27:11.546+02:00</lastOccurrenceTime>
               <lifecycleState>com.hp.nms.incident.lifecycle.Registered</lifecycleState>
               <modified>2017-09-21T14:38:21.565+02:00</modified>
               <name>NodeDown</name>
               <nature>ROOTCAUSE</nature>
               <notes/>
               <origin>MANAGEMENTSOFTWARE</origin>
               <originOccurrenceTime>2017-08-10T16:27:11.545+02:00</originOccurrenceTime>
               <priority>com.hp.nms.incident.priority.None</priority>
               <rcaActive>true</rcaActive>
               <severity>CRITICAL</severity>
               <sourceName>PC3</sourceName>
               <sourceNodeName>PC3</sourceNodeName>
               <sourceNodeUuid>6434ab43-fd1e-4789-ae1f-4137fcfbad5f</sourceNodeUuid>
               <sourceType>com.hp.ov.nms.model.core.Node</sourceType>
               <sourceUuid>6434ab43-fd1e-4789-ae1f-4137fcfbad5f</sourceUuid>
               <uuid>070a5e40-e1fa-4829-a206-658e694ff555</uuid>
            </item>
         </return>
      </inc:getIncidentsResponse>
   </env:Body>
</env:Envelope>

You can use "curl" or Perl modules LWP::UserAgent and HTTP::Request, which we use.

HTH and kind regards

 

Allessandro

 

Highlighted
Trusted Contributor.
Trusted Contributor.

Re: Incident "Assigned To" as variable in Actions

Jump to solution

Hi Allessandro,

Thanks for the quick response.

Do the usage of the web service incident bean demand us to enable the NNMi APIs? Or is this way of extracting information from NNMi available "out-of-the-box"?

BR tsorheim

0 Likes
Highlighted
Acclaimed Contributor.. Acclaimed Contributor..
Acclaimed Contributor..

Re: Incident "Assigned To" as variable in Actions

Jump to solution

Hello tsorheim,

 

Web services are already there, so nothing to enable. Best practice is to define a local user in NNMi with the role "web service client" as you must authenticate the request. A curl call looks like this:

 

curl --user "webserviceclientuser:pwdofuser" --header "content-type: text/xml; charset=utf-8"  --data @/tmp/nnmi_soap_req.xml --output /tmp/nnmi_soap_result.xml -X POST http://<nnmi-server>:<port>/NodeBeanService/NodeBean

The nnmi_soap_req.xml contains the request and output is written to nnm_soap_result.xml. As far as I remember curl has switch for https, too (if you use this).

 

Just another hint: you can add this subfilter below the end of the other subfilter to see the custom incident attributes in the result, too:

 

<subFilters xsi:type="ns3:constraint">

   <name>includeCias</name>

   <value>true</value>

</subFilters>

 

HTH and kind regards

 

Allessandro

View solution in original post

Highlighted
Trusted Contributor.
Trusted Contributor.

Re: Incident "Assigned To" as variable in Actions

Jump to solution

Excellent.

Thank you for the explanation and the suggestions. Very useful information 🙂

BR tsorheim

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.