solarwinds / OrionSDK

SDK for the SolarWinds Orion platform, including tools, documentation, and samples in PowerShell, C#, Go, Perl, and Java.
https://thwack.com/OrionSDK
Apache License 2.0
401 stars 142 forks source link

Getting error when trying to List resources of a Node #222

Open sajithapps opened 4 years ago

sajithapps commented 4 years ago
  job_id = swis.invoke('Orion.Nodes', 'ScheduleListResources', node_id)
    print (job_id)
    status = "Unknown"

    while status == "Unknown":
        status = swis.invoke('Orion.Nodes', 'GetScheduledListResourcesStatus', job_id, node_id)
        print(status)
        time.sleep(10)

    while status != "ReadyForImport":
        status = swis.invoke('Orion.Nodes', 'GetScheduledListResourcesStatus', job_id, node_id)
        print(status)
        time.sleep(10)

    print("Importing list resources...")
    resources = swis.invoke('Orion.Nodes', 'ImportListResourcesResult', job_id, node_id)
    print(resources)
    time.sleep(10)

ERROR:

Unknown ReadyForImport Importing list resources... Traceback (most recent call last): File "./test.py", line 79, in main() File "./test.py", line 59, in main resources = swis.invoke('Orion.Nodes', 'ImportListResourcesResult', job_id, node_id) File "/usr/lib/python2.7/site-packages/orionsdk/swisclient.py", line 31, in invoke "Invoke/{}/{}".format(entity, verb), args).json() File "/usr/lib/python2.7/site-packages/orionsdk/swisclient.py", line 63, in _req resp.raise_for_status() File "/usr/lib/python2.7/site-packages/requests/models.py", line 940, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 400 Client Error: 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. for url: https://solarwindsendpointurl:17778/SolarWinds/InformationService/v3/Json/Invoke/Orion.Nodes/ImportListResourcesResult

sajithapps commented 4 years ago

Also Tried this

    intefaces = swis.invoke('Orion.NPM.Interfaces', 'DiscoverInterfacesOnNode', node_id)
    print (intefaces)

To get the below result:

{u'DiscoveredInterfaces': None, u'Result': 1}

redred623 commented 2 years ago

I am having the same issue. Nodes that I create in the API are not able to use ScheduleListResources and it stays in the unknown status.

prabhdeep10 commented 2 years ago

Any updates on this? I am having the same issue

tfapps commented 2 years ago

I'm having this issue for nodes that are using one of our additional polling engines. I found that moving the node to our main polling engine, running schedulelistresources will succeed, then changing the polling engine back is a workaround for us. Just updating in case this will help anyone else out.