Created
March 11, 2022 15:17
-
-
Save ryanvgates/e15a8cf9411d0cffa2803e9a90a43ea0 to your computer and use it in GitHub Desktop.
Sensu Procdump Check Hook - PowerShell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-Location | |
$scriptPath = $(Split-Path -parent $MyInvocation.MyCommand.Definition) | |
cd $scriptPath | |
Get-Location | |
$main_pid=C:\Windows\system32\inetsrv\appcmd.exe list wps /apppool.name:"mysite" /text:WP.NAME | |
if (Get-Process procdump -ErrorAction SilentlyContinue) { | |
Write-Output "Exiting since procdump is running." | |
exit | |
} | |
C:\procdump\procdump.exe -ma $main_pid -accepteula >> log-procdump.txt | Out-Null | |
iisreset |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment