Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.
Super Contributor.. nareshkumar1985 Super Contributor..
Super Contributor..
212 views

NNMi action using powershell

Jump to solution

Hi Guys,

I am working on an integration where I want to forward alerts from nnmi using action tab. Where I was trying to execute a powershell command. I checked the action log where it says it executed the powershell successfully but the action was never performed. When I manually executed the script it worked as expected. I am not sure what is missing here.

Powershell script is placed under actions folder. 

Example: mypowershellscript.ps1 $ssn

 

Jul 17, 2019 3:59:30.149 PM [ThreadID:12] FINE: com.hp.ov.nms.events.action.log.ActionLogger addToProcessList: Command: ""mypowershellscript.ps1" "Received cbgpFsmStateChange from xxxx (Enterprise : .1.3.6.1.4.1.9.9.187.0.1 , Event forwarded from : \"Invalid or unknown cia cia.remotemgr\" ) at Wed Jul 17 15:59:19 EDT 2019 with 7 parameters, Severity : Critical , Parameters : bgpPeerLastError= , bgpPeerState=1, cbgpPeerLastErrorTxt=hold time expired, cbgpPeerPrevState=3" "Critical" "xxxxxx" "Wed Jul 17 15:59:19 EDT 2019" "x.x.x.x""; Started at Wed Jul 17 15:59:30 EDT 2019; Incident Name: cbgpFsmStateChange; Incident UUID: 5d6a26a1-d8f4-4f82-8274-bc132c3c193f; Command Type: ScriptOrExecutable; Lifecycle state: com.hp.nms.incident.lifecycle.Registered; Exit Code: 0; Standard Output: null; Standard Error: null; Execution Status: null; Ran for 0 milliseconds
Jul 17, 2019 3:59:30.149 PM [ThreadID:12] FINE: com.hp.ov.nms.events.action.log.ActionLogger addToProcessList: 
*******************************************************************************
Command: ""mypowershellscript.ps1" "Received cbgpFsmStateChange from xxxx (Enterprise : .1.3.6.1.4.1.9.9.187.0.1 , Event forwarded from : \"Invalid or unknown cia cia.remotemgr\" ) at Wed Jul 17 15:59:19 EDT 2019 with 7 parameters, Severity : Critical , Parameters : bgpPeerLastError= , bgpPeerState=1, cbgpPeerLastErrorTxt=hold time expired, cbgpPeerPrevState=3" "Critical" "xxxx" "Wed Jul 17 15:59:19 EDT 2019" "x.x.x.x""
Started at 7/17/19 3:59 PM
Incident Name: cbgpFsmStateChange
Incident UUID: 5d6a26a1-d8f4-4f82-8274-bc132c3c193f
Command Type: ScriptOrExecutable
Lifecycle state: com.hp.nms.incident.lifecycle.Registered
Exit Code: 0
Standard Output: null
Standard Error: null
Execution Status: null
Ran for 0 milliseconds
*******************************************************************************
 

Regards,

Naresh

0 Likes
1 Solution

Accepted Solutions
Super Contributor.. nareshkumar1985 Super Contributor..
Super Contributor..

Re: NNMi action using powershell

Jump to solution

Looks like NNMi does not support Powershell and we have only 2 options either use BAT script or jython script. It is disappointing that thins amazing application does not support powershell on windows environment.

I am closing this thread now. If I find another way to execute will post the solution to this thread.

View solution in original post

6 Replies
Super Contributor.. nareshkumar1985 Super Contributor..
Super Contributor..

Re: NNMi action using powershell

Jump to solution

Could someone please let me know how to call a PowerShell under nnmi action where I can pass the variables.

Regards,

Naresh

0 Likes
Super Contributor.. nareshkumar1985 Super Contributor..
Super Contributor..

Re: NNMi action using powershell

Jump to solution
  1. This community was super active when it was part of HP now it is gone. Looks like all NNMi Guru's are gone.

Regards,

Naresh

0 Likes
Acclaimed Contributor.. asoloperto Acclaimed Contributor..
Acclaimed Contributor..

Re: NNMi action using powershell

Jump to solution

Hello Naresh,

 

it might be a special problem with your question as no one is using powershell ;-).

I have successful used Windows Batch (.bat) and OV Perl (.ovpl) without a problem (mainly OV Perl as it is delievered by NNMi).

 

BR Allessandro

0 Likes
Super Contributor.. nareshkumar1985 Super Contributor..
Super Contributor..

Re: NNMi action using powershell

Jump to solution
Hi BR Allessandro,
Since we have NNMi installed on a Windows Box I was expecting PowerShell to be the right option to be called for sending alerts to 3rd party applications. Now I am using Bat file to call the PowerShell to forward the alerts, which is working fine for some time, then stops executing NNMi action for incidents. I have restart NNMi application to work again.

The strange part is, logs do not show any issue on the script and I am not sure why it runs for a day and then it stops executing actions against the incident.

Regards,
Naresh
0 Likes
Super Contributor.. nareshkumar1985 Super Contributor..
Super Contributor..

Re: NNMi action using powershell

Jump to solution

Looks like NNMi does not support Powershell and we have only 2 options either use BAT script or jython script. It is disappointing that thins amazing application does not support powershell on windows environment.

I am closing this thread now. If I find another way to execute will post the solution to this thread.

View solution in original post

Super Contributor.. nareshkumar1985 Super Contributor..
Super Contributor..

Re: NNMi action using powershell

Jump to solution

The issue to fix nnmi action is provided on the following link .

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.