2 Replies Latest reply on Oct 22, 2013 11:58 AM by tnichola

    How to connect to epo server 5.0, through python script?

    dipaliepo

      import mcafee

       

       

      mc = mcafee.client('epo-windows','8443','admin','Infyepo@123')

      print ("hello");

       

       

      When I try to connect to epo server 5.0 , which is located on remote machine by using above python script I am getting following excepion.

      Please suggest the solution.

       

      Traceback (most recent call last):

        File "C:\Python33\lib\urllib\request.py", line 1248, in do_open

          h.request(req.get_method(), req.selector, req.data, headers)

        File "C:\Python33\lib\http\client.py", line 1061, in request

          self._send_request(method, url, body, headers)

        File "C:\Python33\lib\http\client.py", line 1099, in _send_request

          self.endheaders(body)

        File "C:\Python33\lib\http\client.py", line 1057, in endheaders

          self._send_output(message_body)

        File "C:\Python33\lib\http\client.py", line 902, in _send_output

          self.send(msg)

        File "C:\Python33\lib\http\client.py", line 840, in send

          self.connect()

        File "C:\Python33\lib\http\client.py", line 1194, in connect

          self.timeout, self.source_address)

        File "C:\Python33\lib\socket.py", line 417, in create_connection

          for res in getaddrinfo(host, port, 0, SOCK_STREAM):

      socket.gaierror: [Errno 11004] getaddrinfo failed

       

      During handling of the above exception, another exception occurred:

       

      Traceback (most recent call last):

        File "C:\Python33\lib\mcafee.py", line 305, in get_response

          sock = self.create_socket(url, fileargs)

        File "C:\Python33\lib\mcafee.py", line 375, in create_socket

          return self.opener.open(url)

        File "C:\Python33\lib\urllib\request.py", line 469, in open

          response = self._open(req, data)

        File "C:\Python33\lib\urllib\request.py", line 487, in _open

          '_open', req)

        File "C:\Python33\lib\urllib\request.py", line 447, in _call_chain

          result = func(*args)

        File "C:\Python33\lib\urllib\request.py", line 1283, in https_open

          context=self._context, check_hostname=self._check_hostname)

        File "C:\Python33\lib\urllib\request.py", line 1251, in do_open

          raise URLError(err)

      urllib.error.URLError: <urlopen error [Errno 11004] getaddrinfo failed>

       

      During handling of the above exception, another exception occurred:

       

      Traceback (most recent call last):

        File "D:\PythonWorkspace\de.vogella.python.first\src\webapiscriptexample-1.py", line 4, in <module>

          mc = mcafee.client('epo-windows','8443','admin','Infyepo@123')

        File "C:\Python33\lib\mcafee.py", line 537, in __init__

          self._invoker.save_token()

        File "C:\Python33\lib\mcafee.py", line 243, in save_token

          response = self.get_response(url)

        File "C:\Python33\lib\mcafee.py", line 313, in get_response

          log_and_raise_error(logging.ERROR, 'Failed to reach the server %s:%s. Error/reason: %s' % (self.host,self.port,str(e)))

        File "C:\Python33\lib\mcafee.py", line 92, in log_and_raise_error

          raise CommandInvokerError(code, msg)

      mcafee.CommandInvokerError: Failed to reach the server epo-windows:8443. Error/reason: <urlopen error [Errno 11004] getaddrinfo failed>