This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

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

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 emoticons_grin.png

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

Thanks in advance,

JWTech

  • 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

  • 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?

  • 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.

  • 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

  • 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

  • Dear ,

    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

  • 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

  • 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.