Microsoft.Windows.NTServiceStateProvider
Applies To: Operations Manager 2007 R2
The Microsoft.Windows.NTServiceStateProvider data source module type provides the state information of a specific Windows NT service. The module returns System.PropertyBagData data.
Usage
Use this module to provide information regarding a specific Windows NT service in the context of a workflow.
Type Definition
<DataSourceModuleType ID="Microsoft.Windows.NTServiceStateProvider" Accessibility="Public">
<Configuration>
<xsd:element name="Computer" type="xsd:string" />
<xsd:element name="ServiceName" type="xsd:string" />
</Configuration>
<ModuleImplementation>
<Native>
<ClassID>47AA3039-7E86-4b81-B295-67187EDFF3D7</ClassID>
</Native>
</ModuleImplementation>
<OutputType>System!System.PropertyBagData</OutputType>
</DataSourceModuleType>
Parameters
The Microsoft.Windows.NTServiceStateProvider module supports the configuration parameters described in the following table.
Parameter | Type | Description |
---|---|---|
ComputerName |
String |
The name of the computer to query. |
ServiceName |
String |
The service name to query. |
For information about the ComputerName parameter, see Microsoft.Windows.Win32ServiceInformationProbe.
Composition
The Microsoft.Windows.NTServiceStateProvider module is a native module.
Related Modules
Module Type | Usage |
---|---|
Provides the state information of a specific installed or not installed Win32 service. |
|
Provides the state information of a specific installed Win32 service. |
External Module References
None.
Remarks
The module outputs a property bag object that contains data about the service that was queried. The following code example shows an example data item:
<DataItem type="System.PropertyBagData" time="2008-10-08T15:52:27.0027578-07:00" sourceHealthServiceId="B0BE86FA-56AD-1F2E-EE87-8DF72FC53818">
<Property Name="State" VariantType="3">4</Property>
<Property Name="ServiceType" VariantType="3">16</Property>
<Property Name="StartMode" VariantType="3">2</Property>
<Property Name="ErrorControl" VariantType="3">1</Property>
<Property Name="TagId" VariantType="3">0</Property>
<Property Name="ProcessId" VariantType="3">1880</Property>
<Property Name="Name" VariantType="8">MSSQLSERVER</Property>
<Property Name="BinaryPathName" VariantType="8">"C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn\sqlservr.exe" -sMSSQLSERVER</Property>
<Property Name="LoadOrderGroup" VariantType="8"></Property>
<Property Name="Dependencies" VariantType="8"></Property>
<Property Name="ServiceStartName" VariantType="8">LocalSystem</Property>
<Property Name="DisplayName" VariantType="8">SQL Server (MSSQLSERVER)</Property>
<Property Name="Description" VariantType="8">Provides storage, processing and controlled access of data and rapid transaction processing.</Property>
</DataItem>
The data item is a property bag that contains the properties described in the following table.
Property | Description |
---|---|
State |
The current service status. Possible values are:
|
ServiceType |
The type of service. Possible values are:
|
StartMode |
The startup type of the service. Possible values are:
|
ErrorControl |
Severity of the error and the action taken if the service fails to start. Possible values are:
|
TagID |
Unique tag value for this service in the group that is specified by the lpLoadOrderGroup parameter. A value of zero indicates that the service has not been assigned a tag. |
ProcessID |
The current process ID for the service. This is 0 if the service is not currently running. |
Name |
The short service name—for example: MSSQLSERVER |
BinaryPathName |
The path to the executable file for the service, including startup parameters. |
LoadOrderGroup |
Pointer to a null-terminated string that names the load ordering group to which this service belongs. If the member is NULL or an empty string, the service does not belong to a load ordering group. |
Dependencies |
The short service name of services that are dependencies before this service can start. |
ServiceStartName |
The logon account for the service or LocalSystem. |
DisplayName |
The full display name for the service—for example: SQL Server (MSSQLSERVER). |
Description |
The full description for the service. |
Sample
The following example code shows a rule that checks the service state of an NT service and generates an alert if the service is not running:
<Rule ID="Microsoft.Samples.ReadSysLog" Target="Microsoft.Windows.Server.2000.Computer" Enabled="true" ConfirmDelivery="true">
<Category>Custom</Category>
<DataSources>
<DataSource ID="SR" TypeID="AppLog!System.ApplicationLog.NTServiceStateProvider">
<ComputerName>$Target/Host/Property[Type='Windows!Microsoft. Windows.Server.2000.Computer’]/NetworkName$</ComputerName>
<ServiceName>SomeNTService</ServiceName>
</DataSource>
</DataSources>
<ConditionDetection ID="Filter" TypeID="System!System.ExpressionFilter">
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="Integer">State</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value>1</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</ConditionDetection>
<WriteActions>
<WriteAction ID="GenerateAlert" TypeID="Health!System.Health.GenerateAlert">
<Priority>1</Priority>
<Severity>1</Severity>
<AlertMessageId>$MPElement[Name="Microsoft.Samples.AlertMessage"]$</AlertMessageId>
<Suppression>
<SuppressionValue />
</Suppression>
</WriteAction>
</WriteActions>
</Rule>
Information
Module Type |
|
Input Type |
None |
Output Type |
|
Implementation |
Native |
Library |
Microsoft.Windows.Library |