2 Replies Latest reply on Sep 25, 2017 12:21 PM by carballe

    error connection when orion script try to connect with server

    carballe

      Hi! I'm doing an automation with python. I do a script that query about existing nodes in orion. This is my script:

       

      import requests

      from orionsdk import SwisClient

       

      npm_server = 'SSS'

      orion_user = 'UUU'

      orion_pass = 'XXX'

       

      verify = False

      if not verify:

          from requests.packages.urllib3.exceptions import InsecureRequestWarning

          requests.packages.urllib3.disable_warnings(InsecureRequestWarning)

       

      swis = SwisClient(npm_server, orion_user, orion_pass)

      print("Query Test:")

      orion_res = swis.query("SELECT IP_address FROM Orion.Nodes")

       

      orion_list = []

      for row in orion_res['results']:

          orion_list.append("{IP_address}".format(**row))

       

      print orion_list

       

      and this is the error

       

      Query Test:

      Traceback (most recent call last):

        File "./connect2orion.py", line 18, in <module>

          orion_res = swis.query("SELECT IP_address FROM Orion.Nodes")

        File "/usr/lib/python2.7/site-packages/orionsdk/swisclient.py", line 24, in query

          {'query': query, 'parameters': params}).json()

        File "/usr/lib/python2.7/site-packages/orionsdk/swisclient.py", line 59, in _req

          resp.raise_for_status()

        File "/usr/lib/python2.7/site-packages/requests/models.py", line 837, in raise_for_status

          raise HTTPError(http_error_msg, response=self)

      requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://serverXXX:portXXX/SolarWinds/InformationService/v3/Json/Query

       

      I try to do a ping and telnet with the server and i could connect correctly