Microsoft.Windows.Win32ServiceInformationProbe
Applies To: Operations Manager 2007 R2
The Microsoft.Windows.Win32ServiceInformationProbe data source module type is used to query Windows service information from the Service Control Manager at a specified frequency. The module returns the data as System.PropertyBagData data that contains all the properties of the service.
Usage
Use this module to provide information regarding a specific Win32 service in the context of a workflow.
Type Definition
<DataSourceModuleType ID="Microsoft.Windows.Win32ServiceInformationProvider" Accessibility="Public">
<Configuration>
<xsd:element name="ComputerName" type="xsd:string" />
<xsd:element name="ServiceName" type="xsd:string" />
<xsd:element name="Frequency" type="xsd:integer" />
<xsd:element name="DisableCaching" minOccurs="0" maxOccurs="1" type="xsd:boolean" />
<xsd:element name="CheckStartupType" minOccurs="0" maxOccurs="1" 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.Win32ServiceInformationProbe module supports the following configuration parameters:
Parameter | Type | Description |
---|---|---|
ComputerName |
String |
Required parameter. The name of the computer to query. |
ServiceName |
String |
Required parameter. The service name to query. |
Frequency |
Integer |
Required parameter. The frequency in seconds at which the module is to retrieve and return data. |
DisableCaching |
Boolean |
Optional parameter. Determines whether or not to cache the service information. |
CheckStartupType |
String |
Not currently used. |
ComputerName
The ComputerName configuration parameter is most commonly passed to the module by using the $Target notation, although it can be specified as any string.
The module attempts to connect to either the local computer’s Service Control Manager or to a remote computer’s Service Control Manager, depending on the configuration that is passed.
For a workflow that is targeted at a Windows-based computer, the ComputerName parameter is specified as follows:
<ComputerName>$Target/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</ComputerName>
If the target is a class that is hosted by computer hosting, references are added as required. For example:
<ComputerName>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</ComputerName>
ServiceName
The service name specifies the short name of the Windows service to collect data on. For example:
<ServiceName>spooler</ServiceName>
Composition
The Microsoft.Windows.Win32ServiceInformationProbe module is a native module.
Related Modules
Module Type | Usage |
---|---|
Provides the state information of a specific Windows NT service. |
|
Polls for state information about the specified Win32 service and returns data when the state information has changed and/or every tenth poll interval. |
External Module References
The Microsoft.Windows.Win32ServiceInformationProbe module is a member of the following modules:
Module Type | Library | Usage |
---|---|---|
Microsoft.Windows.Library |
The same functionality as the Microsoft.Windows.Win32ServiceInformationProbe except that no data item is output when the service is not installed. |
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 following properties:
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 task that uses the probe to generate data about the default SQL service:
<Task ID="Microsoft.Samples.GetSQLService" Accessibility="Internal" Target="Microsoft.Samples.ApplicationX">
<Category>Operations</Category>
<ProbeAction ID="ServiceProbe" TypeID="Windows!Microsoft.Windows.Win32ServiceInformationProbe">
<ComputerName>$Target/Host/Property[Type='Windows!Microsoft.Windows.Computer']/NetworkName$</ComputerName>
<ServiceName>MSSQLSERVER</ServiceName>
</ProbeAction>
</Task>
The preceding example causes the probe to output data about the default instance of SQL Server.
Information
Module Type |
|
Input Type |
None |
Output Type |
|
Implementation |
Native |
Library |
Microsoft.Windows.Library |