17 Replies Latest reply on Apr 24, 2012 2:09 PM by tdanner

    Solarwinds Information Service - Enable for External API Access

    henricook

      I've recently installed the Orion SDK and I want to be able to use the SWIS from various machines on our network.

       

      I think I need to change the config file so the tcp service on 17777 isn't bound to only localhost any more (hence enabling remote access) but I can't find any documentation on how to do it in the latest NPM/APM version (APMv5??). I found this old knowledgebase link but does anyone have anything more up to date?

       

      http://knowledgebase.solarwinds.com/kb/questions/1992/How+to+change+the+host+name+used+by+the+Orion+SDK+to+connect+to+the+SolarWinds+Information+Service+%28SWIS%29

       

      Thanks,

       

      Henri

        • Re: Solarwinds Information Service - Enable for External API Access
          DanielleH

          Hi Henri,

           

          I've passed this on to our Dev and ID teams.  Thanks.

           

          Danielle

          • Re: Solarwinds Information Service - Enable for External API Access
            aLTeReGo

            The information service runs on TCP port 17777 and is bound to all IP interfaces by default, not only localhost. The information service allows Additional Pollers and Additional Web Servers to communicate with the Orion server remotely which is why it's bound to all IP addresses on the Orion server.

             

            NetStat17777.png

            • Re: Solarwinds Information Service - Enable for External API Access
              henricook

              This is strange, i am trying to add the service through the WCF test client with the URL

               

              orion:17777/SolarWinds/InformationService/OrionBasic

               

              and i'm not getting anything back it says could not find metadata/a service endpoint? I also get a strange closure when telnet'ing to that port from non-localhost - is there anything i can check?

               

              Edit: On our network the box is obviously called 'orion'

                • Re: Solarwinds Information Service - Enable for External API Access
                  henricook

                  Even if I prefix this with a net.tcp:// it doesn't pop anything up - any ideas?

                    • Re: Solarwinds Information Service - Enable for External API Access
                      aLTeReGo

                      Have you run netstat on the Orion server and validated TCP Port 17777 is bound to 0.0.0.0? Have you tried using the IP address instead of the hostname to connect to the server? Lastly, are there any firewalls, or access control lists between your client and the Orion server that could be blocking TCP port 17777?

                        • Re: Solarwinds Information Service - Enable for External API Access
                          henricook

                          I was trying to use 17777 because i'm in the .net wcftestclient, however i can connect to 17778 using wcfstorm client lite. The only problem is when i execute an SDK example command (VBClient) using the wcf storm test client (Calling QueryXml with the 'query' field value of SELECT TOP 1 A.AlertDefID, A.ActiveObject, A.ObjectType FROM Orion.AlertStatus A WHERE A.Acknowledged=0 ORDER BY A.TriggerTimeStamp DESC) I get the following error back from the 17778 service method call.

                           

                          Invoking QueryXml

                          Elapsed : 2.0246644 sec

                          No connection could be made because the target machine actively refused it 127.0.0.1:17777

                           

                          A netstat on the orion box shows 0.0.0.0:17777 as listening

                           

                          If I run the command without specifying a username and password manually in wcfstorm client lite I get a 'username/password must be provided' style error - so the service does return results other than 'cannot connect to 0.0.0.0:17777'

                           

                          Best,

                           

                          Henri

                            • Re: Solarwinds Information Service - Enable for External API Access
                              tdanner

                              The relevant uris are:

                               

                              net.tcp://orion:17777/SolarWinds/InformationService/Orion/ssl

                              https://orion:17778/SolarWinds/InformationService/OrionBasic

                               

                              We use a self-signed certificate for https on port 17778, which greatly simplifies configuration for users, but unfortunately means that many test tools won't work with it. WcfTestClient.exe doesn't appear to have a way to accept an unverifiable certificate for https, so that won't work. I've had success testing this with soapUI.

                               

                              We don't have WCF configured to publish metadata on the net.tcp endpoint, so that won't work with WcfTestClient either.

                               

                              I'm not familiar with wcf storm.

                               

                              For testing, I suggest you use SWQL Studio and the PowerShell snapin that are installed with the Orion SDK. You can install this on any box - it doesn't need to be on the Orion server.

                               

                              SWQL Studio can connect to the HTTPS endpoint. You can use Fiddler to intercept and watch the HTTP traffic between SWQL Studio and the Information Service if you need to see how things are formatted.

                                • Re: Solarwinds Information Service - Enable for External API Access
                                  henricook

                                  Cheers for clarifying the net.tcl url Tim

                                   

                                  When I try and load the :17777 link in wcf test client I get:

                                   

                                  Error: Cannot obtain Metadata from net.tcp://orion:17777/SolarWinds/InformationService/Orion/ssl If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address.  For help enabling metadata publishing, please refer to the MSDN documentation at http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata Exchange Error    URI: net.tcp://orion:17777/SolarWinds/InformationService/Orion/ssl    Metadata contains a reference that cannot be resolved: 'net.tcp://orion:17777/SolarWinds/InformationService/Orion/ssl'.    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:04:59.9909991'.    An existing connection was forcibly closed by the remote host

                                   

                                   

                                  There is no firewall between my machine and 'orion' - and a netstat on the box confirms it's listening on 0.0.0.0:17777

                                   

                                  weird no?

                                    • Re: Solarwinds Information Service - Enable for External API Access
                                      tdanner

                                      I don't think metadata publishing is enabled on that endpoint.

                                        • Re: Solarwinds Information Service - Enable for External API Access
                                          henricook

                                          I might be showing my ignorance here but if Metadata Publishing isn't enabled doesn't that mean I can't add it as a service reference from Visual Studio, in the same way I can't load it and see the available methods from the test client?

                                           

                                          Is :17777 actually intended to be used? Should I be pointing my .NET app at the soap web service on :17778?

                                            • Re: Solarwinds Information Service - Enable for External API Access
                                              tdanner

                                              The Visual Studio Add Service Reference dialog will work with https://localhost:17778/SolarWinds/InformationService. It will warn you about the invalid certificate, but you can accept that and keep going.

                                               

                                              We recommend SOAP on :17778 for SDK users. net.tcp on :17777 is more for SolarWinds internal use.

                                                • Re: Solarwinds Information Service - Enable for External API Access
                                                  henricook

                                                  Sorry if i'm seeming Dense at this point, below is my very simple c# sample - and i'm currently getting  and exception on the QueryXML line saying "The HTTP request was forbidden with client authentication scheme 'Basic'."

                                                   

                                                  Any ideas?

                                                   

                                                   

                                                  namespace solarwinds

                                                  {

                                                      class Program

                                                      {

                                                          static void Main(string[] args)

                                                          {

                                                              ServicePointManager.ServerCertificateValidationCallback = ValidateRemoteCertificate;

                                                   

                                                              InformationServiceClient client = new InformationServiceClient("BasicHttpBinding_InformationService");

                                                            

                                                              client.ClientCredentials.UserName.UserName = @"mydomain\henri cook";

                                                              client.ClientCredentials.UserName.Password = "mypassword";

                                                   

                                                              XmlElement ele = client.QueryXml("SELECT TOP 1 A.AlertDefID, A.ActiveObject, A.ObjectType FROM Orion.AlertStatus A WHERE A.Acknowledged=0 ORDER BY A.TriggerTimeStamp DESC", new System.Data.DataSet());

                                                   

                                                          }

                                                   

                                                          public static Boolean ValidateRemoteCertificate(object sender, X509Certificate cert, X509Chain chain, SslPolicyErrors errors)

                                                          {

                                                              return true;

                                                          }

                                                      }

                                                  }

                                                   

                                                  Edit: InformationServiceClient is of course coming from a service reference to https://orion:17778/SolarWinds/InformationService

                                                    • Re: Solarwinds Information Service - Enable for External API Access
                                                      tdanner

                                                      I see the problem - the current version does not support using Windows accounts with SOAP. It has to be an "Orion" account.

                                                       

                                                      This is fixed in the version currently in development.

                                                      1 of 1 people found this helpful
                                                        • Re: Solarwinds Information Service - Enable for External API Access
                                                          henricook

                                                          Haha thanks Tim, and in my example i've used the query from the VBClient example that comes with the SDK but it's currently causing an exception. Your authentication comment was valid so i'm now using an 'orion' account - thanks for that.

                                                           

                                                          This line:

                                                           

                                                          XmlElement ele = client.QueryXml("SELECT TOP 1 A.AlertDefID, A.ActiveObject, A.ObjectType FROM Orion.AlertStatus A WHERE A.Acknowledged=0 ORDER BY A.TriggerTimeStamp DESC", new System.Data.DataSet());

                                                           

                                                          Generates this exception:

                                                           

                                                          The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://schemas.solarwinds.com/2007/08/informationservice:parameters. The InnerException message was 'There was an error deserializing the object of type SolarWinds.InformationService.Core.PropertyBag. Element 'item' was not found. Line 1, position 542.'.  Please see InnerException for more details.

                                                           

                                                          ... sadly there is no 'innerexception' for me to access for more details in Visual Studio :-( Although here is the stacktrace where solarwinds.orion is my solution's namespace

                                                           

                                                           

                                                          Server stack trace:

                                                             at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)

                                                             at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)

                                                             at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)

                                                             at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)

                                                             at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

                                                           

                                                           

                                                          Exception rethrown at [0]:

                                                             at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)

                                                             at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)

                                                             at solarwinds.Orion.InformationService.QueryXml(QueryXmlRequest request)

                                                             at solarwinds.Orion.InformationServiceClient.solarwinds.Orion.InformationService.QueryXml(QueryXmlRequest request) in c:\temp\solarwinds\solarwinds\Service References\Orion\Reference.cs:line 561

                                                             at solarwinds.Orion.InformationServiceClient.QueryXml(String query, DataSet parameters) in c:\temp\solarwinds\solarwinds\Service References\Orion\Reference.cs:line 568

                                                             at solarwinds.Program.Main(String[] args) in c:\temp\solarwinds\solarwinds\Program.cs:line 24

                                                             at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)

                                                             at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)

                                                             at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()

                                                             at System.Threading.ThreadHelper.ThreadStart_Context(Object state)

                                                             at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)

                                                             at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)

                                                             at System.Threading.ThreadHelper.ThreadStart()

                                    • Re: Solarwinds Information Service - Enable for External API Access
                                      tdanner

                                      That kb article only applies to NPM 10.1 and earlier. More recent versions of NPM handle this automatically.