New MPToolWindowsServiceMonitor - AndreasSobczyk/MPTool GitHub Wiki

#New-MPToolWindowsServiceMonitor Creates a new Windows service monitor for availability state. The monitor will get create auto resolving alerts that match monitor health. The alert serverity can be specified in the command. Returns object of type [Microsoft.EnterpriseManagement.Configuration.ManagementPackUnitMonitorType]

###Parameters

  • ManagementServerFQDN [string] – FQDN of the management server to connect.
    Example - "scomms01.contoso.com"
  • ManagementPackName [string] – Name of the management pack.
    Example - "Contoso.WindowsService.Monitoring”
  • MonitorName [string] – Name of the monitor.
    Example - "W32time.WindowsService.Monitor”
  • MonitorDisplayName [string] – (Optional) Display name of the monitor.
    Example - "W32time WindowsService Monitor”
  • MonitorDescription [string] – (Optional) Description of the monitor.
    Example - " Windows Service Monitor for the class W32time.WindowsService”
  • TargetClassName [string] – Name of the target class.
    Example - "W32time.WindowsService”
  • TargetClassMPName [string] – (Optional) Name of the management pack for the target class.
    Example – “Contoso.W32time.Discovery”
  • TargetClassMPAlias [string] –(Optional) Alias for the management pack for the target class.
    Example – “ContosoW32Discovery”
  • UnhealthyState [String] – The unhealthy state of the monitor. Possible Values: Warning, Error.
    Example - Error
  • ServiceName [String] – The name of the service that needs to be monitored. Specify the service name, not the display name..
    Example – W32Time

###Example Creates a new windows service monitor for the target class W32time.Windowsservice, will monitor if service W32Time is running or not and create a critical error if not.

New-MPToolWindowsServiceMonitor -ManagementServerFQDN SCOMMS01.contoso.com `
-ManagementPackName Contoso.Service.MP `
-MonitorName W32time.WindowsService.Monitor `
-TargetClassName W32time.WindowsService `
-UnhealthyState Error `
-ServiceName W32Time