Microsoft.Windows.Win32ServiceInformationProbe

System Center

Updated: May 18, 2012

Applies To: System Center 2012 - Operations Manager, System Center 2012 R2 Operations Manager, System Center 2012 SP1 - Operations Manager

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

Microsoft.Windows.NTServiceStateProvider

Provides the state information of a specific Windows NT service.

Microsoft.Windows.Win32ServiceInformationProvider

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.ExistingWin32ServiceInformationProbe

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:

  • 0 - Unknown

  • 1 - Stopped

  • 2 – Start pending

  • 3 – Stop pending

  • 4 - Running

  • 5 – Continue pending

  • 6 – Pause pending

  • 7 - Paused

  • 8 – Service not found

  • 9 – Server not found

ServiceType

The type of service. Possible values are:

  • 1 – Kernel/driver

  • 2 – File system driver

  • 16 – Own process

  • 32 – Share process

StartMode

The startup type of the service. Possible values are:

  • 0 – Boot start

  • 1 – System start

  • 2 - Automatic

  • 3 - Manual

  • 4 - Disabled

ErrorControl

Severity of the error and the action taken if the service fails to start. Possible values are:

  • 0 - The startup (boot) program logs the error but continues the startup operation.

  • 1 - The startup program logs the error and displays a message but continues the startup operation.

  • 2: The startup program logs the error. If the last-known good configuration is being started, the startup operation continues. Otherwise, the system is restarted with the last-known-good configuration.

  • 3 - The startup program logs the error, if possible. If the last-known good configuration is being started, the startup operation fails. Otherwise, the system is restarted with the last-known good configuration.

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

ProbeActionModuleType

Input Type

None

Output Type

System.PropertyBagData

Implementation

Native

Library

Microsoft.Windows.Library

 
Show: