Sha256: 6a39efc33e314cfbf4d96b7b0f46256251dec4c1e0444c65cd625e905f95170e

Contents?: true

Size: 1.24 KB

Versions: 12

Compression:

Stored size: 1.24 KB

Contents

#
#   check-windows-processor-queue-length.ps1
#
# DESCRIPTION:
#   This plugin collects the Processor Queue Length and compares against the WARNING and CRITICAL thresholds.
#
# OUTPUT:
#   plain text
#
# PLATFORMS:
#   Windows
#
# DEPENDENCIES:
#   Powershell 3.0 or above
#
# USAGE:
#   Powershell.exe -NonInteractive -NoProfile -ExecutionPolicy Bypass -NoLogo -File C:\\etc\\sensu\\plugins\\check-windows-processor-queue-length.ps1 5 10
#
# NOTES:
#
# LICENSE:
#   Copyright 2016 sensu-plugins
#   Released under the same terms as Sensu (the MIT license); see LICENSE for details.
#

#Requires -Version 3.0

[CmdletBinding()]
Param(
  [Parameter(Mandatory=$True,Position=1)]
   [int]$WARNING,

   [Parameter(Mandatory=$True,Position=2)]
   [int]$CRITICAL
)

$ThisProcess = Get-Process -Id $pid
$ThisProcess.PriorityClass = "BelowNormal"

$Value = (Get-WmiObject Win32_PerfFormattedData_PerfOS_System).ProcessorQueueLength

If ($Value -gt $CRITICAL) {
  Write-Host CheckWindowsProcessorQueueLength CRITICAL: Processor Queue at $Value.
  Exit 2 }

If ($Value -gt $WARNING) {
  Write-Host CheckWindowsProcessorQueueLength WARNING: Processor Queue at $Value.
  Exit 1 }

Else {
  Write-Host CheckWindowsProcessorQueueLength OK: Processor Queue at $Value.
  Exit 0 }

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
sensu-plugins-windows-2.8.1 bin/powershell/check-windows-processor-queue-length.ps1
sensu-plugins-windows-2.8.0 bin/powershell/check-windows-processor-queue-length.ps1
sensu-plugins-windows-2.7.0 bin/powershell/check-windows-processor-queue-length.ps1
sensu-plugins-windows-2.6.0 bin/powershell/check-windows-processor-queue-length.ps1
sensu-plugins-windows-2.5.0 bin/powershell/check-windows-processor-queue-length.ps1
sensu-plugins-windows-2.4.1 bin/powershell/check-windows-processor-queue-length.ps1
sensu-plugins-windows-2.4.0 bin/powershell/check-windows-processor-queue-length.ps1
sensu-plugins-windows-2.3.0 bin/powershell/check-windows-processor-queue-length.ps1
sensu-plugins-windows-2.2.1 bin/powershell/check-windows-processor-queue-length.ps1
sensu-plugins-windows-2.2.0 bin/powershell/check-windows-processor-queue-length.ps1
sensu-plugins-windows-2.1.0 bin/powershell/check-windows-processor-queue-length.ps1
sensu-plugins-windows-2.0.0 bin/powershell/check-windows-processor-queue-length.ps1