Modifying Scripts in SCOM

I’m tinkering around with this Solarwinds MP and there is a discovery ps1 script inside of it. Does anyone know how to find a script such as this after the MP has already been imported? I need to open it, make some changes, and then let it run again. I’m just not sure how to do this.

Thanks,

Gary

1 Like

The script will be stored within the XML of the MP. If the MP is unsealed, you can export it, amend it, increment the version number and re-import.

If it’s sealed, you can’t. Sealed basically uses a cert generated by the vendor that you won’t be able to recreate.

If you simply want to get hold of the script, either to see how it’s comprised or to run it manually, just export the MP. If the MP is sealed, you will only be able to do this via PowerShell via

Export-SCOMManagementPack -ManagementPack ‘MPHere’ -Path ‘ExportLocation’
Once exported, search the XML for 'scriptbody'

hmm he says in his documentation that it’s free and freely distributable and modifiable, but it appears that it is sealed.

 

https://github.com/Juanito99/SolarWinds_NPM_OpsMgr/blob/master/Documentation/Integrate_SolarWinds_NPM_into_OpsMgr.pdf

Gary, good point. – I have added a new, un-sealead verion now to GitHub.

 

Please have a try and let me know if it works.

If you need support to make it work in your environment, let me know.

 

Ruben

 

PS: I wrote modifiable as the sources are available. :slight_smile:

2 Likes

Gary, in principle you’re right. Instead of %sw% you would need to change it to %switch% for instance.

I think first we need to check how exactly the information ‘insight’ of your Solarwinds looks like. - You mentioned that ‘NCM.Nodes’ is not found.

You can use the SWQL studio to do so. - If I remember right, it’s part of the SDK:
https://github.com/solarwinds/OrionSDK

 

Please ensure that you have PowerShell Version 5.x on the machine you specified as ‘monitoring-server’.

 

Let me know …

Thanks Ruben. Here is what I see in the SDK...

HI Gary

I know its an old post but just wanted to share what I did:-)

I use MPButil.exe to modify the MPB -

I followed the guide here:

https://www.silect.com/mpbutil-a-free-utility-for-working-with-mpb-files/

 

br

 

Marcel

Very cool. Thanks Ruben. I’ve never modified a script inside an mp before so this should be interesting. I do know the rest commands I want to run though so just need to change yours. I was hoping your switches/routers and other devices would work but I never could get data retrieved in the SCOM console.

It appears I do need some help here. I see your commands showing any caption like ‘%sw%’ and such. I have the names “core” and “switch” in the Names of nodes in Orion. Is the name the same as caption? If this is correct then I would think I should be receiving data in SCOM, but I’m not.

Now, when I run this url in Postman for example I do get results of all devices with Cisco as vendor:

https://orion:17778/SolarWinds/InformationService/v3/json/Query?query=SELECT Caption, IPAddress FROM Orion.Nodes WHERE Vendor = ‘Cisco’

To add…

I’m running this version of Orion: NPM 12.1, QoE 2.3, VIM 7.0.0, NetPath 1.1.0. My names of nodes do have “switch”, “router”, and “core” in them so I’d be thinking your queries would work fine. However nothing is showing up. If you have any ideas please let me know. When I try to run your queries manually in Postman I get an error that “NCM.Nodes” not found. Orion.Nodes does work but then it errors out on SysContact and AgentIP, etc so I’m not sure what’s going on there.

Thanks,

Gary

It appears NCM.Nodes is Orion.Nodes on mine. I exported the MP and opened the XML file in Notepad ++. I did a find/replace NCM.Nodes to Orion.Nodes. Correct me if I need to do something else. I tried to reimport it but I get this error:

ABC Network SolarWinds NPM could not be imported.

If any management packs in the Import list are dependent on this management pack, the installation of the dependent management packs will fail.

Cannot find resource with ID ABC.Network.SolarWinds.NPM.ArubaController.Icon, ABC.Network.SolarWinds.NPM.CoreSwitch.Icon, ABC.Network.SolarWinds.NPM.Switch.Icon, ABC.Network.SolarWinds.NPM.Router.Icon, ABC.Network.SolarWinds.NPM.FireWall.Icon, ABC.Network.SolarWinds.NPM.OtherDevice.Icon.