Skip Headers

| Previous

# Using the Triggers Tab

The Triggers tab allows you to manage rules that trigger events when a certain condition is met. This is useful for tracking runtime issues without having to constantly monitor the application.

The Triggers tab is divided into the following panels:

- Trigger Rules: Lists all existing rules and lets you add, rename, delete, import, export rules, reset back to the default set of rules, activate and deactivate rules.

- Rule Details: When you select a rule, this panel displays the following subtabs:

  - Condition: Select the attribute and value on which the rule should trigger.

  - Action: Select the event that should be triggered by the rule.

  - Constraints: Select the time constraints for when the rule should be active.

## Working with Trigger Rules

Rules displayed in grey are not available in the monitored JVM. By default, all rules are deactivated. To activate a rule, select the check box next to it.

To add a new trigger rule:

1. Click Add on the Trigger Rules panel.

2. At the first step of the Add New Rule Wizard, select the attribute on which the rule should trigger. Click Next.

3. Set the condition on which the rule should trigger. This step contains the following settings:

   - Max trigger value (for numeric attributes) or Match string (for non-numeric attributes): Specify the maximum value or the matching string for the selected attribute for which the rule should trigger.

   - Sustained time: Specify the duration (in seconds) for which the condition must stay true before the rule is triggered.

   - Limit period: Specify the minimum amount of time (in seconds) that should pass before the rule can be triggered subsequently.

   - Trigger when condition is met: Select whether to trigger the rule when the condition is met. For example, if the trigger value is set to 100, the rule will be triggered when the value changes from less than 100 to 100 or more.

   - Trigger when recovering from condition: Select whether to trigger the rule when the condition is no longer met. For example, if the trigger value is set to 100, the rule will be triggered when the value changes from 100 or more to less than 100.

   Click Next.

4. Select the action you want to occur when the rule triggers. Depending on the action, you may have to provide additional data. The following actions are available:

   - Application Alert: Displays an alert dialog in Java Mission Control.

   - Console Output: Sends a notification to the standard output (stdout) of the console (command prompt) from which the JMX Console was started.

   - Dump Flight Recording: Dumps whatever data is available in a flight recording for the last specified time period (in seconds) to a JFR file.

   - HPROF Dump: Initiates a memory dump to the specified HPROF file.

   - Invoke Diagnostic Command: Invokes the specified diagnostic command and logs output to the specified LOG file by appending or overwriting the results.

   - Log to file: Writes a notification to the specified TXT log file.

   - Send Email: Sends a notification by email. You can configure the SMTP server address and port, the recipients and sender for the email, and provide SSL credentials if secure connection is necessary.

   - Start Continuous Flight Recording: Starts a continuous flight recording.

   - Start Time Limited Flight Recording: Starts a flight recording that will dump the results to a JFR file after the specified time period (in seconds).

   Click Next to continue, or Finish to add the rule as it is.

5. (Optional) Select the time constraints if you want the rule to be active only on specific dates, days of the week, or time of day. Click Next.

6. (Optional) Select the group to which the rule should belong to or specify a new group. Specify the name for the rule and a detailed description.

   You can go back to any previous step in the wizard to modify any of the settings. Click Finish to add the rule to the list.

To edit a rule, select it in the Trigger Rules panel. The Rule Details panel to the right displays three subtabs with the attribute and value on which the rule should trigger, action that is triggered by the rule, and time constraints for when you want the rule to be active.

To rename a rule, select it in the Trigger Rules panel and click Rename. Then provide a new name for the rule and click OK.

If you do not want the rule to trigger, you can deactivate it by deselecting the check box near the rule in the Trigger Rules panel. However, if you are sure you will never use the rule again, you can remove it from the list completely by selecting it and clicking Delete.

To export a set of rules to an XML file, click Export in the Trigger Rules panel. Then select the rules you want to export, specify the file name, and click OK. To import a set of rules from an XML file, click Import in the Trigger Rules panel, select the file and click OK.

To reset back to the default set of rules, click Reset in the Trigger Rules panel and confirm. This will overwrite all the rules and replace them with the default set.

## Viewing Application Alerts

Every time an active rule with the Application Alert action is triggered, the corresponding alert is added to the Trigger Alerts window. The list of triggered application alerts is reset every time you restart Java Mission Control.

To open the Trigger Alerts window, do one of the following:

- Open the Window menu and select Alerts.

- Connect the JMX Console to any JVM, open the Triggers tab, and click Alerts.

The Trigger Alerts window lists all application alerts that have been triggered for a JVM since Java Mission Control was started and connected to the JVM. The list of alerts contains the following columns:

- Date: The date when the alert was triggered.

- Time: The time when the alert was triggered.

- Rule: The name of the rule that triggered the alert.

- Source: The name of the JVM connection for which the alert was triggered as displayed in the JVM Browser. For remote JVM connections, this field contains the IP address and port number.

When you select an alert in the list, its details are displayed in the field under the list. Different information is displayed depending on the selected action event.

Use the Show dialog on alerts check box to toggle whether you want the Trigger Alerts window to open whenever an application alert is triggered.

To clear the list of triggered application alerts, click Clear. Alternatively, the list is cleared whenever you restart Java Mission Control.