Introduction

The Operations Dashboard in AEM 6 helps system operators to monitor AEM system health at a glance. It also provides auto-generated diagnosis informations on relevant aspects of AEM and allows to configure and run self-contained maintenance automation to reduce project operations and support cases significantly. The Operations Dashboard can be extended with custom health checks and maintenance tasks. Further, Operations Dashboard data can be accessed from external monitoring tools via JMX.

The Operations Dashboard:

Is a one-click system status to help operations departments gain efficiency

Health Reports

The Health Report system provides information on the health of an AEM instance through Sling Health Checks. This can be done via either OSGI, JMX, HTTP requests (via JSON) or through the Touch UI. It offers measurements and threshold of certain configurable counters and in some cases, will offer information on how to resolve the issue.

It has several features, described below.

Health Checks

The Health Reports are a system of cards indicating good or bad health with regard to a specific product area. These cards are visualizations of the Sling Health Checks, which aggregate data from JMX and other sources and expose processed information again as MBeans. These MBeans can also be inspected in the JMX web console, under the org.apache.sling.healthcheck domain.

The Health Reports interface can be accessed through the Tools - Operations - Health Reports menu on the AEM Welcome screen, or directly through the following URL:

The card system exposes three possible states: OK, WARN and CRITICAL. The states are a result of rules and thresholds, which can be configured by hovering the mouse over the card and then clicking the gear icon in the action bar:

Health Check Types

There are two types of health checks in AEM 6:

Individual Health Checks

Composite Health Checks

An Individual Health Check is a single health check that corresponds to a status card. Individual Health Checks can be configured with rules or thresholds and they can provide one or more hints and links to solve identified health issues. Let's take the "Log Errors" check as an example: if there are ERROR entries in the instance logs, you will find them on the details page of the health check. At the top of the page you will see a link to the "Log Message" analyzer in the Diagnosis Tools section, which will enable you to analyze these errors in more detail and reconfigure the loggers.

A Composite Health Check is a check that aggregates information from several individual checks.

Composite health checks are configured with the aid of filter tags. In essence, all single checks that have the same filter tag will be grouped as a composite health check. A Composite Health Check will have an OK status only if all the single checks it aggregates have OK statuses as well.

How to create Health Checks

In the Operations Dashboard you can visualize the result of both individual and composite Health Checks.

Creating an individual Health Check

Creating an individual Health Check involves two steps: implementing a Sling Health Check and adding an entry for the Health Check in the Dashboard's configuration nodes.

In order to create a Sling Health Check, you need to create an OSGI component implementing the Sling HealthCheck interface. You will add this component inside a bundle. The properties of the component will fully identify the Health Check. Once the component is installed, a JMX MBean will automatically be created for the Health Check. See the Sling Health Check Documentation for more information.
Example of a Sling Health Check component, written with OSGI service component annotations:

The MBEAN_NAME property defines the name of the mbean that will be generated for this health check.

After creating a Health Check, a new configuration node needs to be created, in order to make it accessible in the Operations Dashboard interface. For this step, it is necessary to know the JMX Mbean name of the Health Check (the MBEAN_NAME property). To create a configuration for the Health Check, open CRXDE and add a new node (of type nt:unstructured) under the following path: /apps/settings/granite/operations/hc

The resource path above is created as follows: if the mbean name of your Health Check is "test", add "test" to the end of the path /system/sling/monitoring/mbeans/org/apache/sling/healthcheck/HealthCheck

Make sure that the /apps/settings/granite/operations/hc path has the following properties set to true:

sling:configCollectionInherit

sling:configPropertyInherit

This will tell the configuration manager to merge the new configurations with the existing ones from /libs.

Creating a Composite Health Check

A Composite Health Check's role is to aggregate a number of individual Health Checks sharing a set of common features. For instance, the Security Composite Health Check groups together all the individual health checks performing security-related verifications. The first step in order to create a composite check is to add a new OSGI configuration. For it to be displayed in the Operations Dashboard, a new configuration node needs to be added, the same way we did for a simple check.

Go to the Web Configuration Manager in the OSGI Console. You can do this by accessing http://serveraddress:port/system/console/configMgr

Search for the entry called Apache Sling Composite Health Check. After you find it, notice that there are two configurations already available: one for the System Checks and another one for the Security Checks.

Create a new configuration by pressing the "+" button on the right hand side of the configuration. A new window will appear, as shown below:

Create a configuration and save it. A Mbean will be created with the new configuration.

The purpose of each configuration property is as follows:

Name (hc.name): The name of the Composite Health Check. A meaningful name is recommended.

Tags (hc.tags): The tags for this Health Check. If this composite health check is intended to be a part of another composite health check (such as in a hierarchy of health checks), add the tags this composite is related to.

MBean Name (hc.mbean.name): The name of the Mbean that will be given to the JMX MBean of this composite health check.

Filter Tags (filter.tags): This is a property specific to composite health checks. These are the tags which the composite should aggregate. The composite health check will aggregate under its group all the health checks that have any tag matching any of the filter tags of this composite. For example, a composite health check having the filter tags test and check will aggregate all the individual and composite health checks that have any of the test and check tags in their tags property (hc.tags).

Note:

A new JMX Mbean is created for each new configuration of the Apache Sling Composite Health Check.

Finally, the entry of the composite health check that has just been created needs to be added in the Operations Dashboard configuration nodes. The procedure for this is the same as with individual health checks: a node of type nt:unstructured needs to be created under /apps/settings/granite/operations/hc. The resource property of the node will be defined by the value of hc.mean.name in the OSGI configuration.

If, for example, you created a configuration and set the hc.mbean.name value to diskusage, the configuration nodes will look like this:

If you create individual health checks that logically belong under a composite check that is already present in the Dashboard by default, they will be automatically captured and grouped under the respective composite check. Because of this, there is no need to create a new configuration node for these checks.

For example, if you create an individual security health check, all you need to do is assign it the "security" tag, and it is installed, it will automatically appear under the Security Checks composite check in the Operations Dashboard.

Health Checks Provided with AEM

zHealthcheck Name

Description

Query Performance

This health check was simplified in AEM 6.4, and now checks the recently-refactored Oak QueryStats MBean, more specifically the SlowQueries attribute. If the statistics contain any slow queries, then the health check returns a warning. Otherwise, it returns the OK status.

Note: This check is available with AEM 6.4 and has been backported to AEM 6.3.2.0.

System Maintenance

System Maintenance is a composite check that returns the OK if all maintenance tasks are running as configured. Keep in mind that:

each maintenance task is accompanied by an associated health check

if a task is not added to a maintenance window, its health check will return Critical

you need to configure the Audit Log and Workflow Purge maintenance tasks or otherwise remove them from the maintenance windows. If left unconfigured, these tasks will fail on the first attempted run, so the System Maintenance check will return the Critical status.

on AEM 6.2 and lower, the system maintenance check returns a Warning status right after startup because the tasks never run. Starting with 6.3, they will return OK if the first maintenance window wasn't reached yet.

This check iterates over replication agents and looks at their queues. For the item at the top of the queue, the check looks at how many times the agent retried replication. If the agent retried replication more than the value of the numberOfRetriesAllowed parameter, it returns a warning. The numberOfRetriesAllowed parameter is configurable.

The Security check is a composite which aggregates the results of multiple security-related checks. These individual health checks address different concerns from the security checklist available at the Security Checklist documentation page. The check is useful as a security smoke test when the instance is started.

Diagnosis tools

The Operation Dashboard also provides access to Diagnosis Tools that can help finding and troubleshooting root causes of the warnings coming from the Health Check Dashboard, as well as providing important debug information for system operators.

Amongst its most important features are:

A log message analyzer

The ability to access heap and thread dumps

Requests and query performance analyzers

You can reach the Diagnosis Tools screen by going to Tools - Operations - Diagnosis from the AEM Welcome screen. You can also access the screen by directly accessing the following URL: http://serveraddress:port/libs/granite/operations/content/diagnosis.html

Log Messages

The log messages User Interface will display all ERROR messages by default. If you want to have more log messages displayed, you need to configure a logger with the appropriate log level.

The log messages use an in memory log appender and therefore, are not related to the log files. Another consequence is that changing the log levels in this UI will not change the information that gets logged in the traditional log files. Adding and removing loggers in this UI will only affect the in memory logger. Also, note that changing the logger configurations will be reflected in the future of the in memory logger - the entries that are already logged and are not relevant anymore are not deleted, but similar entries will not be logged in the future.

You can configure what gets logged by providing logger configurations from the upper left gear button in the UI. There, you can add, remove or update logger configurations. A logger configuration is composed of a log level (WARN / INFO / DEBUG) and a filter name. The filter name has the role of filtering the source of the log messages that get logged. Alternatively, if a logger should capture all the log messages for the specified level, the filter name should be "root". Setting the level of a logger will trigger the capture of all the messages with a level equal or higher than the one specified.

Examples:

If you plan on capturing all the ERROR messages - no configuration is required. All the ERROR messages are captured by default.

If you plan on capturing all the ERROR, WARN and INFO messages - the logger name should be set to: "root", and the logger level to: INFO.

If you plan on capturing all the messages coming from a certain package (for example com.adobe.granite) - the logger name should be set to: "com.adobe.granite", and the logger level to: DEBUG (this will capture all the ERROR, WARN, INFO and DEBUG messages), as shown in the image below.

Note:

You can not set a logger name to capture only ERROR messages via a specified filter. By default, all the ERROR messages are captured.

Note:

The log messages user interface does not reflect the actual error log. Unless you are
configuring other types of log messages in the UI, you will see ERROR messages
only. For how to display specific log messages, see instructions above.

Note:

The settings in the diagnosis page do not influence what is logged to the log files and vice-versa. So, while the error log might catch INFO messages, you might not see them in the log messages UI. Also, through the UI it's possible to catch DEBUG messages from certain packages without it affecting the error log. For more information on how to configure the log files, see Logging.

Note:

With AEM 6.4, maintenance tasks are logged out of the box in a more information rich format at the INFO level. This allows for better visiblity into the state of the maintenance tasks.

In case you are using third party tools (such as Splunk) to monitor and react to maintenance task activity you can make use of the following log statements:

Request performance

The Request Performance page allows the analysis of the slowest page requests processed. Only content requests will be registered on this page. More specifically, the following requests will be captured:

Requests accessing resources under /content

Requests accessing resources under /etc/design

Requests having the ".html" extension

The page displays:

The time when the request was made

The URL and the method of request

The duration in milliseconds

By default, the slowest 20 page requests are captured, but the limit can be modified in the Configuration Manager.

In order to modify the number of slowest requests captured, you need to:

Go to the Web Configuration Manager by accessing http://serveraddress:port/system/console/configMgr

Look for an entry called Adobe Granite Timed Requests Logger.

Click on the Edit button and modify the Longest requests history size property.

Save the changes.

Query Performance

The Query Performance page allows the analysis of the slowest queries
performed by the system. This information is provided by the repository
in a JMX Mbean. In Jackrabbit, the com.adobe.granite.QueryStat JMX Mbean provides this information, while in the Oak repository, it is offered by
org.apache.jackrabbit.oak.QueryStats.

The page
displays:

The time when the query was made

The language of the query

The number of times the query was issued

The statement of the query

The duration in milliseconds

Explain Query

For any given query, Oak attempts to figure out the best way to execute based on the Oak indexes defined in the repository under the oak:index node. Depending on the query, different indexes may be chosen by Oak. Understanding how Oak is executing a query is the first step to optimizing the query.

The Explain Query is a tool that explains how Oak is executing a query. It can be accessed by going to Tools - Operations - Diagnosis from the AEM Welcome Screen, then clicking on Query Performance and switching over to the Explain Query tab.

Features

Supports the Xpath, JCR-SQL and JCR-SQL2 query languages

Reports the actual execution time of the provided query

Detects slow queries and warns about queries that could be potentially slow

Reports the Oak index used to execute the query

Displays the actual Oak Query engine explanation

Provides click-to-load list of Slow and Popular queries

Once you are in the Explain Query UI, all you need to do in order to use it is enter the query and press the Explain button:

The first entry in the Query Explanation section is the actual explanation. The explanation will show the type of index that was used to execute the query.

The second entry is the execution plan.

Ticking the Include execution time box before running the query will also show the amount of time the query was executed in, allowing for more information that can be used for optimizing the indexes for your application or deployment.

The Index Manager

The purpose of the Index Manager is to facilitate index management such as maintaining indexes, viewing their status or triggering re-indexes.

It can be accessed by going to Tools - Operations - Diagnosis from the Welcome Screen, and then clicking the Index Manager button.

It can also be accessed directly at this URL: http://serveraddress:port/libs/granite/operations/content/diagnosis/tool.html/_granite_oakindexmanager

The UI can be used to filter indexes in the table by typing in the filter criteria in the search box in the upper left corner of the screen.

A single reindex can be triggered by clicking the icon in the Reindex column for the respective index. A bulk reindex can be triggered by selecting multiple indexes and clicking the Bulk Reindex button.

Download Status ZIP

This will trigger the download of a zip containing useful information about the system status and configuration. The archive contains contains instance configurations, a list of bundles, OSGI, Sling metrics and statistics and this can result in a large file. You can reduce the impact of large status files by using the Download Status ZIP window. The window can be accessed from: AEM > Tools > Operations > Diagnosis > Download Status ZIP.

From this window you can select what to export (log files and or thread dumps) and the number of days of logs included in the download relative to the current date.

Download Thread Dump

This will trigger the download of a zip containing information about the threads present in the system. Information about each thread is provided, such as its status, the classloader and the stacktrace.

Download Heap Dump

You also have the ability to download a snapshot of the heap, in order to analyze it at a later time. Take note that this will trigger the download of a large file, in the order of hundreds of megabytes.

Automated Maintenance Tasks

The Automated Maintenance Tasks page is a place where you can view and track recommended maintenance tasks scheduled for periodic execution. The tasks are integrated with the Health Check system. The tasks can also be manually executed from the interface.

In order to get to the Maintenance page in the Operations Dashboard, you need to go to Tools - Operations - Dashboard - Maintenance from the AEM Welcome screen, or directly follow this link:

Revision Clean Up

Lucene Binaries Cleanup

By using the Lucene Binaries Cleanup task, you can purge lucene binaries and reduce the running data store size requirement. This is because the lucene's binary churn will be re-claimed daily instead of the earlier dependency on a successful data store garbage collection run.

Though the maintenance task was developed to reduce Lucene related revision garbage, there are general efficiency gains when running the task:

The weekly execution of the data store garbage collection task will complete more quickly

Audit Log Maintenance

Version Purge

You can schedule the Version Purge maintenance task to delete old versions automatically. As a result, this minimizes the need to manually use the Version Purge tools. You can schedule and configure the Version Purge task by accessing Tools > Operations > Maintenance > Weekly Maintenance Window and following these steps:

Click the Add button.

Choose Version Purge from the drop-down menu.

To configure the Version Purge task, click on the gears icon on the newly created Version Purge maintenance card.

With AEM 6.4, you can stop the Version Purge maintenance task as follows:

Automatically - If the scheduled maintenance window closes before the task can complete, the task stops automatically. It will resume when the next maintenance window opens.

Manually - To manually stop the task, on the Version Purge maintenance card, click the Stop icon. On the next execution, the task will safely resume.

Note:

To stop the maintenance task means to suspend its execution without losing track of the job already in progress.

Custom Maintenance Tasks

Custom maintenance tasks can be implemented as OSGi services. As the maintenance task infrastructure is based on Apache Sling's job handling, a maintenance task must implement the java interface org.apache.sling.event.jobs.consumer.JobExecutor. In addition, it must declare several service registration properties to be detected as a maintenance task, as listed below:

Service Property Name

Description

Example

Type

granite.maintenance.isStoppable

Boolean attribute defining whether the task can be stopped by the user. If a task declares that it is stoppable it must check during its execution whether it has been stopped and then act accordingly. The default is false.

true

Optional

granite.maintenance.mandatory

Boolean attribute defining whether a task is mandatory and must be run periodically. If a task is mandatory but currently not in any active schedule window, a Health Check will report this as an error. The default is false.

true

Optional

granite.maintenance.name

A unique name for the task - this is used to reference the task. This is usally a simple name.

MyMaintenanceTask

Required

granite.maintenance.title

A title displayed for this task

My Special Maintenance Task

Required

job.topics

This is a unique topic of the maintenance task.
The Apache Sling job handling will start a job with exactly this topic to execute the maintenance task and as the task is registered for this topic it gets executed.
The topic must start with com/adobe/granite/maintenance/job/

com/adobe/granite/maintenance/job/MyMaintenanceTask

Required

Apart from the above service properties, the process() method of the JobConsumer interface needs to be implemented by adding the code that should be executed for the maintance task. The provided JobExecutionContext can be used to output status information, check if the job is stopped by the user and create a result (success or failed).

For situations where a maintenance task should not be run on all installations (for example, run only on the publish instance), you can make the service require a configuration in order to be active by adding @Component(policy=ConfigurationPolicy.REQUIRE). You can then mark the according configuration as being run mode dependent in the repository. For more information, see Configuring OSGi.

Below is an example of a custom maintenance task that deletes files from a configurable temporary directory which have been modified in the last 24 hours:

Once the service is deployed, it will be exposed to the Operations Dashboard UI and can be added to one of the available maintenance schedules:

This will add a corresponding resource at /apps/granite/operations/config/maintenance/[schedule]/[taskname]. If the task is run mode dependent, the property granite.operations.conditions.runmode needs to be set on that node with the values of the runmodes which need to be active for this maintenance task.

System Overview

The System Overview Dashboard displaysa high-level overview of the configuration, hardware and health of the AEM instance. This means that system health status is transparent and all the information is aggregated in a single dashboard.

Note:

You can also watch this video for an introduction to the System Overview Dashboard.

How To Access

To access the System Overview Dashboard, navigate to Tools > Operations > System Overview.

System Overview Dashboard Explained

The table below, describes all the informations displayed in the System Overview Dashboard. Keep in mind that when there is no relevant information to show (for example, backup is not in progress, there are no health checks that are critical) the respective section will display the "No Entries" message.

You can also download a JSON file summarizing the dashboard information by clicking the Download button in the upper right-hand corner of the dashboard.The JSON endpoint is /libs/granite/operations/content/systemoverview/export.json and it can be used in a curl script for external monitoring.