Re: Python SSHv2 to Cisco routers for multiple commands
Corey Smith <[email protected]> Wed, 11 Mar 2009 09:57:00 -0400
| Newsgroups | gmane.network.toolmakers |
|---|---|
| Message-ID | <[email protected]> |
Have you looked at pxssh in pexpect?
s = pxssh.pxssh(timeout=5, logfile=logfile)
s.login(host, username, password, original_prompt=r'(?i)%s#' % host,
auto_prompt_reset=False)
s.PROMPT = re.compile(r'(?i)^%s' % host, re.MULTILINE)
s.sendline('term length 0')
prompt(s)
s.sendline('term width 512')
prompt(s)
s.sendline('show version')
prompt(s)
-Corey Smith
Sam Crooks wrote:
> The SSH aspect for multiple commands is currently tripping me up.
>
_______________________________________________
Toolmakers mailing list
[email protected]
https://lists.isc.org/mailman/listinfo/toolmakers