System Health Manager Overview

The System Health Manager (SHMA) was previously known as the System Monitor (SysMon). It monitors running processes (system servers) and attempts to restart them if they fail unexpectedly. It may restart the device if it is unable to restart the process.

A application may use the SysMon API to request monitoring for itself or other applications. Only an application with ProtServ capability, however, may request that the device be restarted.

Purpose

Certain applications and background process are essential for the device or for certain applications to function correctly. The System Health Manager ensures that the device remains completely functional by restarting applications or processes, or the device itself, if they stop unexpectedly.

Background

SHMA uses System State Manager (SSM) for process monitoring. SSM provides the required information such as number of restart attempts that can be made, start-up modes and properties. See System State Manager.

Key concepts and terms

Relaunch policy

Specifies the behaviour when a process fails unexpectedly. See Relaunch policy.

Retry Failure policy

Specifies the behaviour when a failed process fails to restart. See Retry Failure policy.

Architecture

The SHMA is simple and self explanatory. A client must instantiate an RSysMonSession to open a session for monitoring.

Monitoring is started with a call to RSysMonSession::MonitorL() or RSysMonSession::MonitorSelfL(). Before calling one of these functions, however, the client must create and populate a CSsmStartupProperties object containing the required monitoring and restart configurations. CSsmStartupProperties has a series of Set...() functions which are used to determine the monitoring and restart behaviour for the process to be monitored.

Figure 1. System Health Manager Architecture

Process monitoring can also be set up using a resource file. CResourceFile accesses a resource file and reads the resource data into a buffer and the data is interpreted using RResourceReader class.

Process monitoring is normally configured for processes using SSM_START_PROCESS_INFO and SSM_START_APP_INFO resources in a static command list. These are defined in ssmcmd.rh. Note that these structures add monitor, startup mode and a localisable error message to SSM_START_PROCESS_INFO and SSM_START_APP_INFO. See Examples.

APIs

SysMon API has the following classes:

Class Description

RSysMonSession

Client-side SysMon session API

CSsmStartupProperties

Contains process starter information.

TSsmMonitorInfo

Convenience class combining restart property information.

Typical uses

System Health Manager is used for requesting and cancelling monitoring for a process.