Our server admin upgraded Solarwinds from a physical server to virtual server. He said he did it by the book. We have alot of python scripts that pull from the solarwinds API that are now broken. When I download the SDK and try to run the example python script from the solarwinds server, I get the following:
PS C:\> python .\SwisClient.py
IP address of NPM Server:
Username:
Password:
Invoke Test:
Traceback (most recent call last):
File ".\SwisClient.py", line 72, in <module>
main()
File ".\SwisClient.py", line 68, in main
samplecode(npm_server,username,password)
File ".\SwisClient.py", line 43, in samplecode
aliases = swis.invoke("Metadata.Entity", "GetAliases", "SELECT B.Caption FROM Orion.Nodes B")
File ".\SwisClient.py", line 18, in invoke
return self._req("POST", "Invoke/%s/%s" % (entity, verb), args).json()
File ".\SwisClient.py", line 37, in _req
headers={'Content-Type': 'application/json'})
File "C:\Anaconda\lib\site-packages\requests\api.py", line 50, in request
response = session.request(method=method, url=url, **kwargs)
File "C:\Anaconda\lib\site-packages\requests\sessions.py", line 468, in request
resp = self.send(prep, **send_kwargs)
File "C:\Anaconda\lib\site-packages\requests\sessions.py", line 576, in send
r = adapter.send(request, **kwargs)
File "C:\Anaconda\lib\site-packages\requests\adapters.py", line 412, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', error(10054, 'An existing connection was forcibly closed by
the remote host'))
I am attaching the script that I am running. The only change was to enter a valid node ID on line 47 as requested by the script (changed to "NodeID=6").
I worked with Solarwinds for a bit before they told me they don't support API. I think this is more than a mere programing issue and something wrong with the internals of Solarwinds.
The odd thing is that I can create a basic powershell script and it runs fine. Here is the powershell code I am running:
Add-PSSnapinswissnapin
$swis=Connect-Swis
[array]$Nodes=Get-SwisData$swis'SELECT NodeID, Caption, MachineType FROM Orion.Nodes'
foreach ($Nodein$Nodes)
{
if (($Node.Caption) -like"su*" ) {
Write-Host$Node.NodeID $Node.Caption $Node.MachineType
}
}
Working with Solarwinds for a short bit, we have already run the configuration wizard to have it fix any services or database issues. I have restarted all services and still get the same error. I have run the Solarwinds Diagnostics and searched for this error in the logs. I see the same error code and response in the Core.BusinessLayer logs, but that doesn't tell me much.
Here are the versions we are running: Orion Platform 2015.1.2, VNQM 4.2.2, IPAM 4.3, SAM 6.2.2, DPA 10.0.0, NCM 7.4, IVIM 2.1.0, QoE 2.0, NPM 11.5.2
Any help is much appreciated.