Network Deployment (Distributed operating systems), v8.0 > Troubleshoot and support > Work with Diagnostic Providers > Diagnostic Providers


Diagnostic Provider registered attributes and registered tests

Diagnostic Providers (DP) provide...

Registered attribute are available from one release of WAS to the next. Non-registered attributes might not be available in future releases. The DP can request only registered values, or all values. Filtering is available the DP's JMX MBean interface, accessed programmatically or through wsadmin.sh.


Filter results

DiagnosticProviderRegistration.xml is used in conjunction with the method signatures to filter the results of calling the various methods. This XML file defines the configuration information, state information, and self diagnostic tests exposed by the component. In the configuration and state information, the key working unit is referred to as the attribute. Specification of an attribute is as follows:

<attribute>  
    <id> attribute_name </id>  
    <descriptionKey> MsgKey_ResourceBundle_localization </descriptionKey>  
    <registered> true </registered>
</attribute> 

...where...

ID The attribute's name. Can be expressed with regexp. Used...

  • Within DP configuration and state dump methods

  • In the console to match description keys with attributes returned from a request.

For example, if a configuration dump returns an attribute with ID...

    cachedServlet-MyServlet-servletPath

...the console could use the descriptionKey corresponding to the attribute registered as...

    <id>cachedServlet-.*-servletPath </id>

...when selecting what description text to put next to this attribute's name and return values.

descriptionKey Key into a resourceBundle for localization.
registered Boolean qualifying whether this attribute will be available from one release of the software to the next. If registered is true, then this attribute should be available in the next release. If registered is false, then there is no guarantee that this attribute will continue to exist. Automation should use some caution when handling non-registered attributes.

Specification of a selfDiagnosticTest is as follows:

<test> 
<id>
<Regular Expression for the name of the test>
</id> 
<descriptionKey>
<MsgKey into a ResourceBundle for localization of the label>
</descriptionKey> 
<attribute>
<One or more attributes which will be output from this test>
</attribute>
</test> 

The parts are as follows:

ID:

Similar to the ID for the attribute, but in this case, describing the test to be performed instead of the attribute to be returned.

descriptionKey:

This is a key into a resourceBundle for localization.


Method interfaces

public DiagnosticEvent [] configDump(String aAttributeId, boolean aRegisteredOnly);
public DiagnosticEvent [] stateDump(String aAttributeId, boolean aRegisteredOnly);

These methods invoke the configuration or state dump on the component, and specify a regular expression filter for the attributes to return as well as filtering the output to include all matching attributes, or only those attributes which are registered. This enables the administrator or automated software driving the method to specify a subset of the overall fields (especially important if many attributes are exposed or if the State Collection Specification increases the amount of data available). The following helper methods are available to assist with filtering the output.

To take a list of Attributes that are available to return, and filter them:

    public static AttributeInfo [] queryMatchingDPInfoAttributes(String aAttributeId,         AttributeInfo [] inAttrs, String [] namesToCheck, boolean aRegisteredOnly) {
To take a single Attribute that is available to return, and filter it:
    public static AttributeInfo queryMatchingDPInfoAttributes(String aAttributeId,         AttributeInfo [] inAttrs, String nameToCheck, boolean aRegisteredOnly) {
To go through a populated set of Attribute Information and remove unneeded parts:
    public static void filterEventPayload(String aAttributeId, HashMap payLoad) {

For details on these messages, please review the API documentation for the DiagnosticProviderHelper class. The basic concept is that, once the component knows what attributes are able to be returned, the helper method will determine which of them should be returned based on the regular expression logic and registration boolean.

The selfDiagnostic Method interface here is similar to that of Configdump and Statedump:

public DiagnosticEvent[] selfDiagnostic(String aTestId, boolean aRegisteredOnly)
The difference is that the first parameter is a regular expression filter for which test to run.
Work with Diagnostic Providers

+

Search Tips   |   Advanced Search