09-29-2022 09:05 PM - edited 09-29-2022 09:05 PM
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
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
09-30-2022 03:41 AM - edited 09-30-2022 10:27 PM
Any course of action on this, I'm having a relative issue. I tried to change things and this is what happened.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide