The following sample XML code is an example of a typical representation of an asset mapping structure:
<?xml version="1.0" encoding="UTF-8"?> <asset-converter>
<datasource type="">
<connection-properties> </connection-properties>
</datasource>
<!-- Specifies the parameters for processing -->
<processing-info>
<max-assets-to-process value=""/>
</processing-info>
<!-- Specifies the output settings -->
<output-settings>
<dest-dir value=""/> <output-filename value=""/>
</output-settings> CA MDB
<mdb-type>10</mdb-type> <mdb-connection-properties> </mdb-connection-properties>
</mdb>
<!-- data mapping -->
<asset translator="ACBsFmt" version="1_0">
<general >
<host_name value=""/>
<default_hostname value=""/>
<default_address value=""/>
<default_mac value=""/>
</general>
<hardware>
<group name="GeneralInventory">
<attribute name="" value=""/>
<group name="">
</group>
.
.
.
</group>
<group name="AdditionalInventory">
<attribute name="" value=""/>
.
.
.
<group name="">
</group>
.
.
.
</group>
</hardware>
<software>
<package name="" >
<attribute name="" value=""/>
.
.
.
</software>
</asset>
</asset-converter>
The asset tag contains the following tags:
The general tag contains the following tags to provide general information about the assets:
Important! The first four tags (host_name, default_mac, default_hostname, and default_address) are required for the CA Asset Converter to load the XML files correctly. The required attributes cannot contain hard-coded values.
Note: All XML files you create, and the sample XML code used in this guide must be well-formed and comply with XML and XSD standards.
Example: General Tag (Database)
The following sample XML code illustrates how to use the general tag for a database.
<asset query="select AssetID from Computer" translator="ACBsFmt" version="1_0">
<general query="select c.hostname,c.IPAddress, c.MAC_Address from Computer c where c.AssetID = {asset.AssetID}">
<host_name value="{asset:general.hostname}"/>
<default_hostname value="{asset:general.hostname}"/>
<default_address value="{asset:general.IPAddress}"/>
<default_mac value="{asset:general.MAC_Address}"/>
</general>
...
</asset>
Example: General Tag (Flatfile)
The following sample XML code illustrates how to use the general tag for a flatfile.
<asset file="main" translator="ACBsFmt" version="1_0">
<general file="main">
<host_name value="[4]"/> (Note: The 4 specifies it is mapped to the 4th column in the main file) <default_hostname value="[4]"/> <default_address value="[3]"/> <default_mac value="[2]"/>
</general>
...
</asset>
The hardware tag contains the following groups:
Example: Hardware Tag (Database)
The following sample XML code illustrates how to use the hardware tag for a database.
<asset query="select AssetID from Computer" translator="ACBsFmt" version="1_0">
<general> ... </general> <hardware>
<group name="GeneralInventory">
<group name="System" query="select p.ProcCount from Computer c where c.AssetID = {asset.AssetID}">
<attribute name="No. of Processors" type="string" value="{group(name='System').ProcCount}"/>
</group>
</group>
</hardware> ...
</asset>
Example: Hardware Tag (Flatfile)
The following sample XML code illustrates how to use the hardware tag for a flatfile.
<hardware>
<group name="GeneralInventory" file=""> <group name="System" file="system">
<attribute name="Model" type="string" value="[2]"/> <attribute name="Type" type="string" value="[3]"/> <attribute name="Vendor" type="string" value="[4]"/>
</group> <group name="Network" file="main">
<attribute name="Computer Name" type="string" value="[4]"/> <attribute name="IP Address" type="string" value="[3]">
</group> ...
</hardware>
Example: Additional Inventory Tag
The following sample XML code illustrates how to use the additional inventory tag.
<asset> ... <hardware>
<group name="GeneralInventory"> ... </group> <group name="AdditionalInventory">
<attribute name="SourceVendor" value="ThirdPartyTool"/>
</group>
</hardware> </asset>
The software tag contains information about the software packages installed in the asset.
Example: Software Tag (Database)
The following sample XML code illustrates how to use the software tag for a database.
<asset query="select AssetID from Computer" translator="ACBsFmt" version="1_0"> ... <hardware>
<group name="GeneralInventory"> ... </group>
<group name="AdditionalInventory"> ... </group>
</hardware> <software>
<package name="{asset:software:package.title}" query="select title,version,vendor from softwareTable where AssetID={asset.AssetID}">
<attribute name="Ver" type="string" value="{asset:software:package.version}"/>
<attribute name="Pub" type="string" value="{asset:software:package.vendor}"/>
</package> </software>
</asset>
Example: Software Tag (Flatfile)
The following sample XML code illustrates how to use the software tag for a flatfile.
<software>
<package name="Advanced Network Diagramming" file="system">
<attribute name="Ver" type="string" value=[1]/> <attribute name="Pub" type="string" value=[2]/> ...
</package>
</software>
|
Copyright © 2013 CA.
All rights reserved.
|
|