cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
49
Views
0
Helpful
4
Replies
Highlighted
Cisco Employee

SSH into Cisco device

I’m looking for easiest way to execute a "show ip dhcp binding“ command on a Cisco device. As far as I can see this is not covered with NED and modelled in Yang. I see classes NedWorked, NedMux, SSHConnection but don’t understand how they fit together. Any example on how to put it together would be much appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
Cisco Employee

Re: SSH into Cisco device

Just like any other action:

 

 

--------

 

NavuAction action1 = device.container("live-status").

 

                    container("ios-stats","exec").

 

                    action("show");

 

ConfXMLParam[]  args1 = new ConfXMLParam[1];

 

Conflict l1 = new ConfList();

 

l1.addElem(new ConfBuf(ip dhcp binding"));

 

args1[0] = new ConfXMLParamValue("ios-stats", "args", l1);  

 

    

 

// I execute the action and receive response as XML

 

    

 

ConfXMLParam[] resArr1 = action1.call(args1);

 

--------

 

 

You then need to navigate the output XML array…there are different ways, depending of your taste. Check the JavaDoc for ConfXMLParam[].

 

View solution in original post

4 REPLIES 4
Cisco Employee

Re: SSH into Cisco device

admin@ncs> request devices device ce0 live-status ios-stats:exec show args ip dhcp binding

Cisco Employee

Re: SSH into Cisco device

Sorry, forgot to mention that I would like to do it from Java package…

Cisco Employee

Re: SSH into Cisco device

Just like any other action:

 

 

--------

 

NavuAction action1 = device.container("live-status").

 

                    container("ios-stats","exec").

 

                    action("show");

 

ConfXMLParam[]  args1 = new ConfXMLParam[1];

 

Conflict l1 = new ConfList();

 

l1.addElem(new ConfBuf(ip dhcp binding"));

 

args1[0] = new ConfXMLParamValue("ios-stats", "args", l1);  

 

    

 

// I execute the action and receive response as XML

 

    

 

ConfXMLParam[] resArr1 = action1.call(args1);

 

--------

 

 

You then need to navigate the output XML array…there are different ways, depending of your taste. Check the JavaDoc for ConfXMLParam[].

 

View solution in original post

Cisco Employee

Re: SSH into Cisco device

THANKS!!!! Just the thing I needed!

Content for Community-Ad
August's Community Spotlight Awards