QuestionQ95
VerifiedOperationsDrag and drop the code snippets below into the boxes in the code to enable operational data, and then retrieve interface data. Not all options are used.
Drag & Drop
from ncclient import manager def get_interface_state(host, port, user, passwd, filename): with manager.connect(host, port, user, passwd) as m: with open as f: rpc_reply = m.(target='running', config=f.read()) rpc_reply = m.(filter=('subtree', "<interfaces-state/>")) return(rpc_reply)
Community Discussion