Network Deployment (Distributed operating systems), v8.0 > Troubleshoot and support > Work with Diagnostic Providers
Create a Diagnostic Provider
Overview
Use Diagnostic Providers to query the startup configuration, current configuration, and current state of a diagnostic domain. Diagnostic Providers also provide access to any self diagnostic tests that are available from a diagnostic domain.
Create Diagnostic Providers
- Determine your diagnostic domain.
Look for configuration MBeans that control a similar domain in the same component. Extending an existing configuration MBean with a DP interface avoids proliferation of new MBeans and has the benefit that mapping from a diagnostic MBean to a configuration MBean requires no additional information.
- Determine what configuration attributes to expose.
Include information used to configure your component from the configuration MBeans.
- Determine what state attributes to expose.
Anything you might want to know about the state of your component for troubleshooting can go here.
- Determine what self diagnostic tests you will expose.
- Determine what test attributes you will return for each self diagnostic.
- Create your DP registration XML file.
- Create your DP implementation.
- To see an example, refer to Implement a Diagnostic Provider.
- To ensure that you do not collect unwanted data, add hooks in your component code where collect state data using the DiagnosticConfig object.
- Add hooks in your component code where store or be able to access configuration data.
- Add code to register your DP implementation. Typically, the best place to do this is where your component is initialized.
- Add Diagnostic Provider IDs (DPID) to your logged messages. Registering a DPID with a logger makes that information available in any messages logged with this logger. This enables fast paths in the DP utility to function on this particular Diagnostic Provider.
- Register your DPID with your loggers (for any of your loggers that you only want to associate a single DPID with).
- When you use multiple DPIDs with the same Logger, you can (instead of registering a single DPID with a Logger) add DPIDs to individual logging calls in the parm[0] position. Do not put {0} in the corresponding localized messages. It is bad practice to print the DPID in your messages as this would be inconsistent with messages from loggers with statically assigned DPIDs.
Related
Diagnostic Provider Extensible Markup Language
Choosing a Diagnostic Provider name
Implement a Diagnostic Provider
Create a Diagnostic Provider registration XML file