Fix Pack
2

Auto-defining extended attributes for sensors

You can define extended attributes for any sensor and use them to store the sensor data automatically.

To define extended attributes for sensors, create an IdML book with extended attributes definitions. The name of this book must be xa.xml. Place the file in the particular OSGi bundle directory, for example $COLLATION_HOME/osgi/plugins/com.ibm.cdb.discover.sensor.sys.examplesensor_1.0.0/xa.xml.

Each time the TopologyBuilder service is started, new and changed books are automatically loaded. During the loading process, the bulk load program is run with the -loadEAMeta option enabled, automatically defining extended attributes. For details about the bulk load program, see Auto-defining extended attributes for public Java API and bulk load program.

To view the extended attributes in the TADDM UI, you must restart the TADDM server.

If you want to configure the bulk loading process of books that contain extended attributes, you can use the $COLLATION_HOME/etc/bulkload.properties file, which stores bulk load program configuration.

Example of usage
The com.ibm.cdb.discover.sensor.sys.foobarsensor_1.0.0/xa.xml file contains extended attributes definitions that are used by the example FoobarSensor. During the first server start, after the TopologyBuilder service is initialized, TADDM loads the com.ibm.cdb.discover.sensor.sys.foobarsensor_1.0.0/xa.xml book. Then, CRC32 sum of the xa.xml file is calculated and stored in the com.ibm.cdb.discover.sensor.sys.foobarsensor_1.0.0/xa.xml.crc file. The CRC32 sum is calculated each time the xa.xml file is changed. The books are loaded by the TopologyBuilder service only when the check sum changes.
Example structure of the xa.xml file
<idml:idml xmlns:idml="http://www.ibm.com/xmlns/swg/idml" xmlns:cdm="http://www.ibm.com/xmlns/swg/cdm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ibm.com/xmlns/swg/idml idml.xsd">
	<idml:source IdMLSchemaVersion="0.8">
		<cdm:process.ManagementSoftwareSystem CDMSchemaVersion="2.8">
			<cdm:MSSName>your data</cdm:MSSName>
			<cdm:Hostname>your data</cdm:Hostname>
			<cdm:ManufacturerName>your data</cdm:ManufacturerName>
			<cdm:ProductName>your data</cdm:ProductName>
			<cdm:ProductVersion>your data</cdm:ProductVersion>
			<cdm:Label>your data</cdm:Label>
		</cdm:process.ManagementSoftwareSystem>
	</idml:source>
	
	<!-- Operation... -->
	<idml:operationSet opid="1">
		<idml:create timestamp="2012-07-12T05:10:58Z">
		<cdm:CDM-ER-Specification>
			<cdm:sys.ComputerSystem id="CS" sourceToken="CS">
			<cdm:extension>
			    <cdm:extattr name="sensor_foobar_xa1" category="_internal"></cdm:extattr>
			</cdm:extension>
			</cdm:sys.ComputerSystem>
		</cdm:CDM-ER-Specification>
		</idml:create>
	</idml:operationSet>
</idml:idml>