Creating a Health Add-In
Published: December 17, 2010
Updated: October 17, 2013
Applies To: Windows Home Server 2011, Windows Server 2012 Essentials, Windows Small Business Server 2011 Essentials, Windows Storage Server 2008 R2 Essentials
A health add-in provides definitions for alerts, health checks, and repairs for network problems. A health add-in consists of xml files that annotate code or data that is used to evaluate health information for a specific feature.
|The examples in this section include creating a file called Definition.xml to contain the health definitions. It is permissible to change these user-defined Definition.xml files, but it is not permissible to change the Definition.xml files that are delivered with the product.|
|A health definition can be included in other add-ins and is not required to be an individual add-in. Health add-in logs for diagnosing user issues with creating health add-ins are located in the %ProgramData%\Microsoft\Windows Server\Logs folder with a file name beginning with NetworkHealthPlugin- followed by the add-in name.|
The code that is included in a health add-in can be a PowerShell script or managed code. To learn more about using PowerShell, download the Windows PowerShell 1.0 Documentation Pack (http://go.microsoft.com/fwlink/?LinkId=120542). For more information about using XML, see XML Overviews (http://go.microsoft.com/fwlink/?LinkId=120543).
Setting up the development environment
You can develop a health add-in on your own development computer or you can develop a health add-in on a test server. The examples in this section use Visual Studio 2010 and take advantage of template you can download.
Confirm that you have installed the Windows Server Essentials SDK.
In Visual Studio, click Tools, and then click Extensions and Updates….
On the Extensions and Updates dialog, click Online, and then search for “Windows Server”.
In the results pane, click on Windows Server Essentials Add-In Templates, and then click Download.
On the Installation dialog, click Install, and then click Close.
The WSS Health Add-In template should now be available on the New Project dialog, in the Templates directory.
To make adding XML elements easier, the following schemas are added to the template:
Creating the health add-in files
A health add-in consists of a Definition.xml file and a Definition.xml.config file. See the following subsections for information about how to create the XML files that are needed for a health add-in:
Installing the health add-in files
After you create the xml files, you must place a copy of the files in the appropriate location on the server and client computers.
To install the xml files on the server
In the %ProgramFiles%\Windows Server\Bin\FeatureDefinitions folder, create a new folder named MyHealthAddIn. You can give this folder any name. It is suggested that the name of the folder be the same as the feature name.
Copy the Definition.xml and the Definition.xml.config files to the new folder.
If you created binary files for conditions or actions, you should also copy those files to %ProgramFiles%\Windows Server\Bin.
Client computers run a scheduled task every 6 hours that pulls the XML files to the appropriate location. You can force the synchronization between the client computer and the server by manually running the task.
To install the xml files on the client computer
Open Task Scheduler.
Run the HealthDefintionUpdateTask in Task Scheduler.
Note This task does not install binary files. You must manually copy the binary files to the %ProgramFiles%\Windows Server\Bin folder on the client computer.