As part of one of our projects, we deployed vRealize on one of our servers (Server 1). We also have in our infrastructure, a PowerShell Server (Server 2) and a Solarwinds Server (Server 3).
What we would like to implement is a vRO workflow that runs on Server 1 and calls the PowerShell script on Server 2. The PowerShell script needs to connect to Solarwinds and run a query. For connecting to Solarwinds, we are using Orion SDK.
The PowerShell script connects to Solarwinds using the following command:
#Connect to the SolarWinds Server
$Swis=Connect-Swis–V2-Trusted-Hostname$Server
#build the SWQL query
$Query="SELECT R.Address as SubnetAddress, R.CIDR, R.FriendlyName, R.PercentUsed, (SELECT TOP 1 I2.IpAddress FROM IPAM.IPNode as I2 WHERE I2.Status=$($IPStatusAvailable) AND I2.SubnetId = R.GroupID) AS FreeIpAddress FROM IPAM.GroupReport as R WHERE R.CIDR='$($CIDR)' AND SubnetAddress = '$($Network)'";
#retrieve the IP
$AddressesWithSubnets=Get-SwisData$Swis$Query;
There are two scenarios we tested:
• Someone connected using Remote Desktop on the PowerShell server and executed the PowerShell script. Everything went well, and the script returned the results we were expecting.
• Someone executed the VRA workflow (which connects to the PowerShell server and runs the script).
The script fails with the following error:
- System.ServiceModel.CommunicationException: The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '00:00:59.9530496'. ---> System.IO.IOException: The write operation failed, see inner exception. ---> System.ServiceModel.CommunicationException: The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '00:00:59.9530496'. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at System.ServiceModel.Channels.SocketConnection.Write(Byte[] buffer, Int32 offset, Int32 size, Boolean immediate, TimeSpan timeout)
--- End of inner exception stack trace ---
at System.ServiceModel.Channels.SocketConnection.Write(Byte[] buffer, Int32 offset, Int32 size, Boolean immediate, TimeSpan timeout)
at System.ServiceModel.Channels.BufferedConnection.WriteNow(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout, BufferManager bufferManager)
at System.ServiceModel.Channels.BufferedConnection.Write(Byte[] buffer, Int32 offset, Int32 size, Boolean immediate, TimeSpan timeout)
at System.ServiceModel.Channels.ConnectionStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at System.Net.Security.NegotiateStream.StartWriting(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.NegotiateStream.ProcessWrite(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
--- End of inner exception stack trace ---
at System.Net.Security.NegotiateStream.ProcessWrite(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.NegotiateStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at System.ServiceModel.Channels.StreamConnection.Write(Byte[] buffer, Int32 offset, Int32 size, Boolean immediate, TimeSpan timeout)
--- End of inner exception stack trace ---
Some things we did to troubleshot the error:
• Ensure the users have access on Solarwinds
• Configured WINRS
• Opened all the port on Solarwinds server
Our investigation revealed that Solarwinds resets the connection for some reason.
Could you please help us troubleshoot this problem?