Building Block: Health Rules

Applies to: SharePoint Foundation 2010

SharePoint Health Analyzer monitors the health of SharePoint Foundation throughout a server farm by applying a set of health rules. A health rule is executable code that is deployed in a compiled assembly at the server farm level and registered with SharePoint Health Analyzer. When a rule is registered, a timer job is created to run the rule. An item for the rule is then added to the Health Analyzer Rule list under Review rule definitions in the Monitoring section of Central Administration.

A number of health rules are included with SharePoint Foundation. You can create and deploy additional rules by writing code that uses the SharePoint Foundation object model.

Object Model for Health Rules

The classes that you can use to create health rules are located in the Microsoft.SharePoint.Administration.Health namespace. The most important classes include the following:

A health rule is deployed in a compiled assembly and registered with the SharePoint Health Analyzer by a call to the RegisterRules(Assembly) method of the SPHealthAnalyzer class. A good place to call this method is in the event handler for the FeatureActivated event of an SPFeatureReceiver object. When a rule is registered, a timer job is created to run the rule by using default parameters that are specified by the rule's AutomaticExecutionParameters property.

Building Block: Features

Building Block: Solutions

More Information about Health Rules

Overview of SharePoint Health Analyzer

Developing and Deploying a Custom Health Rule