Sha256: 9719437beb2827e8ed98ad386540f4baef2cf819f2f55a2538954ca65c93e968

Contents?: true

Size: 919 Bytes

Versions: 15

Compression:

Stored size: 919 Bytes

Contents

#
#   check-windows-process.ps1
#
# DESCRIPTION:
#   This plugin checks whether a User-inputted process is running or not.
#
# 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-process.ps1
#
# 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)]
   [string]$ProcessName
)

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

$Exists = Get-Process $ProcessName -ErrorAction SilentlyContinue

If (!$Exists) {
  Write-Host CRITICAL: $ProcessName not found!
  Exit 2 }

If ($Exists) {
  Write-Host OK: $ProcessName running.
  Exit 0 }

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
sensu-plugins-windows-3.0.0 bin/powershell/check-windows-process.ps1
sensu-plugins-windows-2.9.1 bin/powershell/check-windows-process.ps1
sensu-plugins-windows-2.9.0 bin/powershell/check-windows-process.ps1
sensu-plugins-windows-2.8.1 bin/powershell/check-windows-process.ps1
sensu-plugins-windows-2.8.0 bin/powershell/check-windows-process.ps1
sensu-plugins-windows-2.7.0 bin/powershell/check-windows-process.ps1
sensu-plugins-windows-2.6.0 bin/powershell/check-windows-process.ps1
sensu-plugins-windows-2.5.0 bin/powershell/check-windows-process.ps1
sensu-plugins-windows-2.4.1 bin/powershell/check-windows-process.ps1
sensu-plugins-windows-2.4.0 bin/powershell/check-windows-process.ps1
sensu-plugins-windows-2.3.0 bin/powershell/check-windows-process.ps1
sensu-plugins-windows-2.2.1 bin/powershell/check-windows-process.ps1
sensu-plugins-windows-2.2.0 bin/powershell/check-windows-process.ps1
sensu-plugins-windows-2.1.0 bin/powershell/check-windows-process.ps1
sensu-plugins-windows-2.0.0 bin/powershell/check-windows-process.ps1