Customizing MapOS.xml

The MapOS.xml file is used by Auto-Discovery to map a unique string obtained from the CLI to that device's operating system.

Before you begin

Before editing the MapOS.xml file, you must be familiar with XML.

About this task

This task requires that you become familiar with the XML tags described in the following table:

XML tag Description

<vendorlist>

The MapOS.xml file contains <vendorlist> tags. Embedded inside are <vendor>, <os>, and <output> tags. The name attribute in the <vendor> tags indicates that everything enclosed within these tags apply to the specified vendor, which in this example are CISCO and Juniper devices only. The name attribute in each <os> tag is used to match the os number returned in a CLI call.

Procedure

  1. Open the MapOS.xml file for editing.
  2. Edit the XML tags according to your needs. Use the Example section as a guide.
  3. When you are satisfied with your edits, save and exit the MapOS.xml file.

Example

Consider the following XML tags in a sample MapOS.xml file:

<vendorlist>
	<vendor name="Cisco">  1 
		<os name="10.5">  2 
		<output>10.3</output>  3 
		</os>
	</vendor>
</vendorlist>

Now consider the following return from the Auto-Discovery tool when it uses a RegexList.xml file to parse the CISCO CLI:

vendor=Cisco  1 
model=2651 
os=12.4(5A) 2 

The Auto-Discovery tool:

  1. Compares the value Cisco returned to vendor with the value specified in the name attribute of the <vendor> tag. The values match.
  2. Compares the value 12.4(5A) returned to os with the value specified in the name attribute of the <os> tag. These values do not match.
  3. Returns the value specified in the <output> tag, if the values in os and <os> match.

    Because the values specified in os and <os> do not match, the Auto-Discovery tool performs no mapping for a CISCO device with an os string of 12.4(5A). Thus, the os number remains as it is.

Consider the following XML tags for Juniper in a sample MapOS.xml file:

<vendor name="Juniper">  1 
<model name="M4">  2 
<output>M40</output>  3 
</model>
</vendor>
</vendorlist>

<vendorlist>
	<vendor name="Juniper">  1 
		<os name="6.2R2.4">  2 
			<output>6.0</output> 3 
		</os>
	</vendor>
</vendorlist>

Now consider the following return from the Auto-Discovery tool when it uses a RegexList.xml file to parse the Juniper CLI:

vendor=Juniper  1 
model=M40
os=6.2R2.4  2 

The Auto-Discovery tool:

  1. Compares the value Juniper returned to vendor with the value specified in the name attribute of the <vendor> tag. The values match.
  2. Compares the value 6.2R2.4 returned to os with the value specified in the name attribute of the <os> tag. These values match.
  3. Returns the value specified in the <output> tag (in this case 6.0), because the values in os and <os> match.

    Thus, the Auto-Discovery tool performs a mapping of the os numbers for a Juniper device because the values specified in os and <os> match.

What to do next

To study a complete working example of a MapOS.xml file, see MapOS.xml example.