Created
March 20, 2014 03:20
-
-
Save Mierdin/9656533 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Requires ncclient - https://github.com/leopoul/ncclient | |
from ncclient import manager | |
host = '192.168.7.140' | |
user = 'admin' | |
password = 'Cisco.com' | |
with manager.connect(host=host, port=22, username=user, password=password, hostkey_verify=False, device_params={'name':'nexus'}) as m: | |
#c = m.get_capabilities() | |
#for a in c: | |
# print '[LOG - NXOS DETECTED CAPABILITY]: ----- ' + a | |
print 'done' | |
OUTPUT: | |
[LOG - SUBSYSTEM DETECTED]: ----- netconf-subsystem-1 | |
[LOG - SUBSYSTEM DETECTED]: ----- xmlagent-subsystem-2 | |
[LOG - DISPATCH_MSG]: ----- <?xml version="1.0" encoding="ISO-8859-1"?> | |
<hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> | |
<capabilities> | |
<capability>urn:ietf:params:xml:ns:netconf:base:1.0</capability> | |
<capability>urn:ietf:params:netconf:base:1.0</capability> | |
</capabilities> | |
<session-id>26918</session-id> | |
</hello> | |
done | |
[LOG - DISPATCH_MSG]: ----- <?xml version="1.0" encoding="ISO-8859-1"?> | |
<nc:rpc-reply xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:7700d2b0-afde-11e3-aec4-005056c00008"> | |
<nc:ok/> | |
</nc:rpc-reply> | |
[Finished in 2.2s] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment