Questo contenuto non è disponibile nella lingua selezionata.
6. Using Dynamic Groups
Note
6.1. About Dynamic Groups Syntax Copia collegamentoCollegamento copiato negli appunti!
6.1.1. General Expression Syntax Copia collegamentoCollegamento copiato negli appunti!
Note
| 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.attribute, then it applies to the resource which will be a member of the group. However, it is possible to use an attribute in an ancestor or child entry to identify a group member recursively.
resource.id = 10001
resource.id = 10001
resource.parent:
resource.parent.id = 10001
resource.parent.id = 10001
- resource
- resource.child
- resource.parent
- resource.grandParent
6.1.2. Simple Expressions Copia collegamentoCollegamento copiato negli appunti!
resource.attribute[string-expression] = value
resource.attribute[string-expression] = value
resource.parent.type.category = Platform
resource.parent.type.category = Platform
resource.trait is the generic resource attribute, and a sub-attribute like partitionName identifies the actual parameter.
empty keyword searches for resources which have a specific attribute with a null value:
empty resource.attribute[string-expression]
empty resource.attribute[string-expression]
empty keyword is used, then there is no value given with the expression.
not empty keyword, which looks for every resource with that attribute, regardless of the attribute value, as long as it is not null. As with the empty keyword, there is no reason to give a value with the expression, since every value matches the expression.
not empty resource.attribute[string-expression]
not empty resource.attribute[string-expression]
6.1.3. Pivot Expressions Copia collegamentoCollegamento copiato negli appunti!
groupby keyword:
groupby resource.attribute
groupby resource.attribute
parent.name attribute creates a unique group based on every parent resource.
groupby resource.parent.name
groupby resource.parent.name
Figure 34. Resources and Parents
6.1.4. Compound Expressions Copia collegamentoCollegamento copiato negli appunti!
resource.parent.type.category = Platform
resource.parent.type.category = Platform
resource.parent.type.category = Platform resource.name.contains = JBossAS
resource.parent.type.category = Platform
resource.name.contains = JBossAS
groupby resource.type.plugin groupby resource.type.name groupby resource.parent.name
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.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]
resource.type.plugin = JBossAS
resource.type.name = JBossAS Server
empty resource.pluginConfiguration[principal]
6.1.5. Unsupported Expressions Copia collegamentoCollegamento copiato negli appunti!
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.
A property can only be used once in a dynagroup definition.
resource.trait expression can only occur once in a definition:
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.grandParent.trait[Trait.hostname].contains = stage resource.parent.type.plugin = JBossAS5 resource.type.name = Web Application (WAR) resource.trait[contextRoot] = jmx-console
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]
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
resource.parent.trait[x] = foo
resource.grandParent.trait[y] = bar
6.1.6. Dynagroup Expression Examples Copia collegamentoCollegamento copiato negli appunti!
Example 1. JBoss Clusters
resource.type.plugin = JBossAS resource.type.name = JBossAS Server groupby resource.trait[partitionName]
resource.type.plugin = JBossAS
resource.type.name = JBossAS Server
groupby resource.trait[partitionName]
Example 2. A Group for Each Platform Type
resource.type.plugin = Platforms resource.type.category = PLATFORM groupby resource.type.name
resource.type.plugin = Platforms
resource.type.category = PLATFORM
groupby resource.type.name
Example 3. Autogroups
groupby resource.type.plugin groupby resource.type.name groupby resource.parent.name
groupby resource.type.plugin
groupby resource.type.name
groupby resource.parent.name
Note
Example 4. Raw Measurement Tables
resource.type.plugin= Postgres resource.type.name = Table resource.parent.name = rhq Database resource.name.contains = rhq_meas_data_num_
resource.type.plugin= Postgres
resource.type.name = Table
resource.parent.name = rhq Database
resource.name.contains = rhq_meas_data_num_
Example 5. Only Agents with Multicast Detection
resource.type.plugin= RHQAgent resource.type.name = RHQ Agent resource.resourceConfiguration[rhq.communications.multicast-detector.enabled] = true
resource.type.plugin= RHQAgent
resource.type.name = RHQ Agent
resource.resourceConfiguration[rhq.communications.multicast-detector.enabled] = true
Example 6. Only Windows Platforms with Event Tracking
resource.type.plugin= Platforms resource.type.name = Windows resource.pluginConfiguration[eventTrackingEnabled] = true
resource.type.plugin= Platforms
resource.type.name = Windows
resource.pluginConfiguration[eventTrackingEnabled] = true
Example 7. JBoss AS Servers by Machine
groupby resource.parent.trait[Trait.hostname] resource.type.plugin = JBossAS resource.type.name = JBossAS Server
groupby resource.parent.trait[Trait.hostname]
resource.type.plugin = JBossAS
resource.type.name = JBossAS Server