reading the running config file from a network device

966 views Asked by At

Is there any way to read the running configuration file from a network device (cisco ios/ juniper junos) in a properly formatted type say for eg as an XML file?

Basically I need to get all the attributes and its values in a config file. I am using "expect" to read the config file. I would have to write a parser to get the attributes from the config file.

I was wondering if there would be already an implementation of this which I can re-use? Is there any SDK that can be used to parse the config file, or even better , directly interact with the device and get the data in a standard format?

Kindly guide.

Thanks Sunil

2

There are 2 answers

0
Axenow On BEST ANSWER

For Juniper in configuration mode:

show | display xml

For Cisco IOS I've never made this, but you can try to use ODMSpec: http://www.cisco.com/en/US/docs/ios-xml/ios/xmlpi/command/xmlpi-cr-book.pdf http://www.cisco.com/en/US/docs/net_mgmt/enhanced_device_interface/2.2/developer/guide/progodm.html

I'm not sure, that it works with running-config.

0
S_R On

In ios devices, it is

show run | format

This would give the result in an xml format