22.3.1 Custom.xml

The following XML shows the structure of a custom data collection:

  
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE classes SYSTEM "items-mysql-monitor.dtd">
<classes>

	<class>
		<namespace>NameSpace</namespace>
		<classname>ClassName</classname>
              <precondition><![CDATA[Add Precondition Query Here]]></precondition>
              <query><![CDATA[Add Main Query Here]]></query>
              <attributes
                  <attribute name="AttributeName1"/>
                  <attribute name="AttributeName2"/>
              </attributes>
	</class>

</classes>

Table 22.2 Custom Data Collection Class Elements

ElementDescription
classesContainer element for all defined classes.
classContainer element for the definition of the collection.
namespaceLogical grouping for the new data collection item.
classnameName of the custom data collection. Do not use spaces or special characters in this element.
precondition(Optional) Query which checks some conditions. If the query returns true, the main query is executed. For example, the precondition query can be used to check the version of the MySQL server. See Section 22.3.2.1, “Precondition Queries” for more information.
queryThe main query. For more information, see Section 22.3.2.2, “Main Queries”
attributesEnables you to label the types of data returned by the query. Possible types are: STRING, INTEGER, and FLOAT. This information is required by the advisor receiving the data. It is also possible to define one or more attributes as counters. See Section 22.3.3, “Data Collection Attributes” for more information.


The values in the namespace and classname elements are used as the first two elements of the name.