Red Hat Training
A Red Hat training course is available for Red Hat JBoss Operations Network
Chapter 7. Using Dynamic Groups
7.1. About Dynamic Groups Syntax
7.1.1. General Expression Syntax
- By a specific resource attribute or value (a simple expression)
- By the resource type (a pivoted expression)
- By membership in another group (a narrowing expression)
expression 1 exprA1 exprA2 groupby exprB1 groupby exprB2 expression 2 exprA2 exprA1 groupby exprB2 groupby exprB1
Table 7.1. Dynamic Group Properties
Type | Supported Attributes | ||||||
---|---|---|---|---|---|---|---|
Related to the resource itself | |||||||
resource
|
| ||||||
Related to the resource type | |||||||
resourceType
|
| ||||||
Related to the resource configuration | |||||||
plug-inConfiguration
|
Any plugin configuration property
| ||||||
resourceConfiguration
|
Any resource configuration property
| ||||||
Related to the resource monitoring data | |||||||
traits
|
Any monitoring trait
| ||||||
availability
|
The current state, either UP or DOWN
|
resource.id = 10001
resource.parent.id = 10001
- resource
- resource.child
- resource.parent
- resource.grandParent
7.1.2. Simple Expressions: Looking for a Value
resource.attribute[string-expression] = value
resource.parent.type.category = Platform
resource.trait
is the generic resource attribute, and a sub-attribute like partitionName
identifies the actual parameter.
empty resource.attribute[string-expression]
not empty resource.attribute[string-expression]
7.1.3. Pivot Expressions: Grouping by an Attribute
groupby resource.attribute
parent.name
attribute creates a unique group based on every parent resource.
groupby resource.parent.name
Figure 7.1. Resources and Parents
7.1.4. Narrowing Expressions: Members of a Group
memberof = "Dev Resource Group" groupby resource.type.name
7.1.5. Compound Expressions
resource.parent.type.category = Platform
resource.parent.type.category = Platform resource.name.contains = JBossAS
groupby resource.type.plugin groupby resource.type.name groupby resource.parent.name
resource.type.category = server groupby resource.type.plugin groupby resource.type.name groupby resource.parent.name
resource.type.plugin = JBossAS resource.type.name = JBossAS Server empty resource.pluginConfiguration[principal]
7.1.6. Unsupported Expressions
All expressions must be in the same configuration area.
All given configuration properties in an expression must be only from the resource configuration or only from the plug-in configuration. Expressions cannot be taken from both.
Each property must only be used once.
A property can only be used once in a dynagroup definition.
valid resource.trait[x] = foo not valid resource.trait[x] = foo resource.trait[y] = bar
resource.grandParent.trait[Trait.hostname].contains = stage resource.parent.type.plugin = JBossAS5 resource.type.name = Web Application (WAR)
resource.grandParent.trait[Trait.hostname].contains = stage resource.parent.type.plugin = JBossAS5 resource.type.name = Web Application (WAR) resource.trait[contextRoot] = jmx-console
There was a problem calculating the results: java.lang.IllegalArgumentException: org.hibernate.QueryParameterException: could not locate named parameter [arg2]
resource.parent.trait[x] = foo resource.grandParent.trait[y] = bar
7.1.7. Dynagroup Expression Examples
Example 7.1. JBoss Clusters
resource.type.plugin = JBossAS resource.type.name = JBossAS Server groupby resource.trait[partitionName]
Example 7.2. A Group for Each Platform Type
resource.type.plugin = Platforms resource.type.category = PLATFORM groupby resource.type.name
Example 7.3. Autogroups
groupby resource.type.plugin groupby resource.type.name groupby resource.parent.name
Example 7.4. Raw Measurement Tables
resource.type.plugin= Postgres resource.type.name = Table resource.parent.name = rhq Database resource.name.contains = rhq_meas_data_num_
Example 7.5. Only Agents with Multicast Detection
resource.type.plugin= RHQAgent resource.type.name = RHQ Agent resource.resourceConfiguration[rhq.communications.multicast-detector.enabled] = true
Example 7.6. Only Windows Platforms with Event Tracking
resource.type.plugin= Platforms resource.type.name = Windows resource.pluginConfiguration[eventTrackingEnabled] = true
Example 7.7. JBoss AS Servers by Machine
groupby resource.parent.trait[Trait.hostname] resource.type.plugin = JBossAS resource.type.name = JBossAS Server