'Open connection to the router and get arp entries.'

def _get_arp_data(self):

    from pexpect import pxssh
    import re
    try:
        cisco_ssh = pxssh.pxssh()
        cisco_ssh.login(self.host, self.username, self.password, port=self.port, auto_prompt_reset=False)
        initial_line = cisco_ssh.before.decode('utf-8').splitlines()
        router_hostname = initial_line[(len(initial_line) - 1)]
        router_hostname += '#'
        regex_expression = ('(?i)^%s' % router_hostname).encode()
        cisco_ssh.PROMPT = re.compile(regex_expression, re.MULTILINE)
        cisco_ssh.sendline('terminal    length    0')
        cisco_ssh.prompt(1)
        cisco_ssh.sendline('show    ip    arp')
        cisco_ssh.prompt(1)
        devices_result = cisco_ssh.before
        return devices_result.decode('utf-8')
    except pxssh.ExceptionPxssh as px_e:
        _LOGGER.error('pxssh    failed    on    login')
        _LOGGER.error(px_e)
    return None
