cancel
Showing results for 
Search instead for 
Did you mean: 
Create Post
Level 8

List resources/volumes for agent managed nodes via SWIS API (Powershell)

Jump to solution

Hi all,

I work in an business which is too locked down for WMI, thus we use agents for virtually everything. I'm working on automating the node creation, agent install, volume and interface discovery and editing of the custom properties.

While creating a short script to edit the custom properties for Volume Threshold monitoring, I realised I needed to get the node to discover the volumes in the first place (working backwards is a terrible idea) for me to actually edit the custom properties for said volumes. This is where my problem started.

I cant seem to figure out a way of initiating the "List Resources" through the API. This has been asked many times before, I am well aware, but no working answers have been presented for an agent based platform. There's a verb to list the interfaces, and add them, but seemingly volumes are impossible via anything other than SNMP using the Network Discovery tool.

Unless there is a way of automating the process of adding the node as SNMP, discovering the volumes using the Discovery Tool, and then installing the agent and using the API to change all the monitoring over to agent?

I'm looking for any option here, Invoke, CRUD, Rest, preferably using Powershell but if you have accomplished it in another language, post your code anyway and I'll figure it out

PS - I work almost exclusively with SAM, so servers etc. I can't use solutions that only work with NPM.

Thanks in advance,

JWTech

0 Kudos
1 Solution

Unfortunately there is no SWIS API equivalent for that "rediscover agents" checkbox. I have added a link to this thread to the internal case (DC-1537) to serve as a vote and a reminder to reply in this thread when this gets implemented and released.

View solution in original post

9 Replies
Level 8

Hi all,

this older post was just brought into my attention. And I think I might have good news for you. We implemented this functionality in latest 2019.4 release. Please check KB article Update resources on agent node in bulk for more details.

Please let me know if that helped or in case of any questions or troubles.


Thanks,
Miro

Dear @mvalentovic ,

I am delighted to see ,the most awaited automation script available right way and  My current work desperately need - .\ImportListResources.ps1 to execute without errors.

I have installed Orion.SDK and imported powerOrion into Powershell,

I am facing below issue, while executing.. "

.\ImportListResources.ps1 $swis 2 600
Creating schedule list resources job...
Waiting until job status will be 'ReadyForImport'...
Importing list resources...
Invoke-SwisVerb : Could not load file or assembly 'SolarWinds.Interfaces.Discovery.Strings, Version=3.5.0.638,
Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
At C:\SAM\New folder\OrionSDK-master\Samples\PowerShell\ImportListResources.ps1:72 char:17
+ ... ortResult = Invoke-SwisVerb $swis "orion.nodes" "ImportListResourcesR ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Invoke-SwisVerb], FaultException`1
+ FullyQualifiedErrorId : SwisError,SwisPowerShell.InvokeSwisVerb
Import of ListResources result for NodeId:2 finished with errors.
At C:\SAM\New folder\OrionSDK-master\Samples\PowerShell\ImportListResources.ps1:76 char:5
+ throw ("Import of ListResources result for NodeId:" + $nodeId + " ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (Import of ListR...ed with errors.:String) [], RuntimeException
+ FullyQualifiedErrorId : Import of ListResources result for NodeId:2 finished with errors.

Inorder to run this script, Do i still need to have ''SwisPowerShell'' module also installed.. Kindly please guide through

 

0 Kudos

This is now being investigated under https://github.com/solarwinds/OrionSDK/issues/223.

0 Kudos

In SAM 2019.1 , Noticed that in Swis ,it is looking for version '3.5.0.638' ,while actually we have a updated version '3.5.0.652' in Orion application files

Application file: SolarWinds.Interfaces.Discovery.Strings.dll

Path :C:\Program Files (x86)\SolarWinds\Orion\Interfaces.Discovery

Current Version : 3.5.0.652

 

Can some one, help to solve the issues, please

0 Kudos

Hi, 

How can we customize it to avoid resources we don't want ? Such as 'windows scheduled tasks', physical/virtual memory as volumes, unknown interfaces ?

 

thanks

0 Kudos

How can we customize it to avoid resources we don't want ? Such as 'windows scheduled tasks', physical/virtual memory as volumes, unknown interfaces ?

I don't believe it is possible to filter the set of resources to import at present.

0 Kudos
Level 12

Hi,

About a month later have you any information to share about adding resources to server monitored with an agent ?

It seems that the agent API is not developped as much as the SNMP or WMI.

Cheers

0 Kudos

tdanner

This raises a point I never noticed, none of the examples for the $CorePluginConfiguration that can find include whatever the syntax needs to be to check the box for rediscovering agents.  I've got examples for bulklist and subnets, but also no references for how you guys would need a request to look for AD groups, or for a router based discovery.

Any chance you could get someone to dig up some sample code for those other scenarios?

- Marc Netterfield, Github
0 Kudos

Unfortunately there is no SWIS API equivalent for that "rediscover agents" checkbox. I have added a link to this thread to the internal case (DC-1537) to serve as a vote and a reminder to reply in this thread when this gets implemented and released.

View solution in original post