31.2.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 31.2 Custom Data Collection Class Elements

Element Description

classes

Container element for all defined classes.

class

Container element for the definition of the collection.

namespace

Logical grouping for the new data collection item.

classname

Name 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 31.2.2.1, “Precondition Queries” for more information.

query

The main query. For more information, see Section 31.2.2.2, “Main Queries”

attributes

Enables 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 31.2.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.