Zum Hauptinhalt springen

How to load only a part of a XML configuration on a device - Wissensdatenbank / Produkte / HiOS - Belden Support Center

How to load only a part of a XML configuration on a device

 

For support or for deploying specific settings on several devices it may be useful to extract part of the config of an XML and still have a loadable XML file.
This how to show step by step how to do it.
I'll use for that a simple example:
From an XML file with a complete configuration, I'll just extract the settings related to the DHCP server settings and load them on another device.

A good knowledge of the MIBs is required to do this kind of operation that's why this how to is destinated to skilled people.

Open the XML config file with Notepad++

Like you can see, all the levels are uncollapsed.

Fold all

Fold all (From Notepad++ toolbar: View > Fold all)
Expand the Config level.
As you can see there are 3 sub levels: Header, MibData and Footer
The configuration settings are contained in MibData.
Expand this level. You will find a lot of sublevels. Each of them correspond to a part of the configuration.

Search the MIB containing the settings you want to load

A good knowledge of the MIBs or good intuition are of course required, but the name of most of the MIB usually helps to identify what settings are contained in the MIB.
For example see above: DNS, INDUSTRIAL-PROTOCOLS, MRP ...
In my case I'm interested in HM2-DHCPS-MIB. Uncollapsing this level I can make sure that it contains the settings related to the DHCP server function (see above)

Delete the other MIBs sections (1)

Delete the MIBs above.
To do that correctly, expand the MIB section preceding the MIB you want to keep, in our case it's SFLOW-MIB (see above)
Then select and delete all the lines between <MibData> under the Header section until the last line of the SFLOW-MIB (see above)

Delete the other MIBs sections (2)

Delete the MIBs below.
Take care not to include the <MibData> just above the Footer section.

Modify the header

In the header, change if necessary the productId to make it match with the device on which the file with the DHCP server settings will be loaded.
The product ID can be found using the CLI typing ""show system info"", it corresponds to the ""Device hardware Description"" or on the sticker at the right side of the device.
In my case I will upload the file on a rsp30_08033o6zt. All the characters need to be entered in the file in lower case.
Save the file under a new name.
For my example I use the name conf_dhcp.xml

Upload the file on the device

Your file if it was correctly modified will be accepted.
You should find in the logs of the device the following log: ""Configuration might not be loaded completely due to -fingerprint mismatch-"" which is normal because the checksum doesn't match. All the settings which can be loaded will nevertheless be loaded.