Database Reference
In-Depth Information
Listing 10-18.
Boot Date Dynamic Property Example from
sample_host1
Target
<InstanceProperties>
<InstanceProperty ...>...</InstanceProperty>
<DynamicProperties NAME="HostSampleBootDate" PROP_LIST="bootDate" FORMAT="ROW">
<QueryDescriptor FETCHLET_ID="OSLineToken">
<Property .../>
<Property NAME="script" SCOPE="GLOBAL">
%scriptsDir%/sample_host1/data_collector.pl --collect BootDate --fake "%fake%"
</Property>
<Property .../>
</QueryDescriptor>
</DynamicProperties>
</InstanceProperties>
A dynamic property can then be referenced in the fetchlet configuration for metrics in the
Property
element with
SCOPE="INSTANCE"
—just like any other static property.
You can find more information on
DynamicProperties
in Section 3.3.6.2 of the
Extensibility Programmer's
Reference
. However, the official documentation is pretty sparse. You can find more details in the XML Schema
documentation under
<EDK>/doc/partnersdk/mrs/emcore/targetType
.
One of the best uses of dynamic properties is to define category properties that are, in turn, used for conditional
definitions in the target type metadata using a
ValidIf
element. This element can be defined as a child of several
elements such as
Metric
or
QueryDescriptor
so that certain metrics are activated only when the defined category
property is matching certain choices. Another use case is to configure different fetchlets to collect metric values
depending on the value of category property. Unfortunately, as of EM12c version 12.1.0.2.0, this functionality
is not officially documented, so you should be careful relying on it. However, it was available since
Grid Control 10g versions, and you can see how it's used in Oracle's out-of-the-box plug-ins (for example,
in its
rac_database
target type). You can find the
rac_database
target type metadata definition in
<AGENT_BASE>/plugins/oracle.sysman.db.agent.plugin_12.1.0.2.0/metadata/rac_database.xml
.
Note that Oracle uses XML functionality by including other files' XML content to facilitate the reuse of identical
definitions. For example, the database version calculations are the same for the RAC database, the ASM instance,
and the database instance, so it's defined in the
dyn_props.xmlp
file that's referred from multiple target type
metadata definition files.
Note that Oracle's
sample_host
targets include other dynamic properties defining related links. I believe that this
part of the example has not been removed since 10g/11g Grid Control and isn't relevant anymore. Prior to EM12c, the
Extensibility framework had very few features to customize the home page of a target, and adding custom links to the
related links section on the home page was one of them. EM12c has rich target user interface definition options, and
related links via dynamic properties are not used anymore, so this dynamic property in all
sample_host
demo targets
is ignored and should have been removed.