cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
349
Views
0
Helpful
1
Replies

Examples of using plink.exe to get config via xmlagent?

kwongheng22
Level 1
Level 1

Hi all,

First off, I am an absolute newbie at this ssh xml stuff. So I was reading about how use the xmlagent on my cisco 9k switches

Cisco Nexus 9000 Series NX-OS Programmability Guide, Release 9.3(x) - XML Management Interface [Cisco Nexus 9000 Series Switches] - Cisco

What I want to do is simply to perform a show running-config using xmlagent with plink.exe (windows) in a single command

However, there are no examples on how that without being interactive. I have successful managed to login via the xmlagent but its stuck at an interactive prompt. 

plink.exe -ssh -2 user1@cisco9k.com -s xmlagent

Started a shell/command
<?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>
<capability>urn:ietf:params:netconf:capability:validate:1.0</capability>
<capability>urn:ietf:params:netconf:capability:writable-running:1.0</capability>
<capability>urn:ietf:params:netconf:capability:url:1.0?scheme=file</capability>
<capability>urn:ietf:params:netconf:capability:rollback-on-error:1.0</capability>
<capability>urn:ietf:params:netconf:capability:candidate:1.0</capability>
<capability>urn:ietf:params:netconf:capability:confirmed-commit:1.0</capability>
</capabilities>
<session-id>18582</session-id>
</hello>
]]>]]>

But when I try to send hello, it doesn't work

plink.exe -ssh -2 user1@cisco9k.com -s xmlagent -m .\hello.xml

Server refused to start a shell/command
FATAL ERROR: Server refused to start a shell/command

What I want to achieve is to run a single non-interactive command to export running-config as xml using xml agent so my thoughts are that the command line should look like this, where get-config.xml is the properly formated XML instance. 

plink.exe -ssh -2 user1@cisco9k.com -s xmlagent -m .\get-config.xml

Any advise?

Regards

Kelvin Wong

 

 

 

1 Reply 1

barrykaauamo
Level 1
Level 1

Any course of action on this, I'm having a relative issue. I tried to change things and this is what happened.

Flying Together United