Re: Check Windows Process memory
Posted: Mon Jan 18, 2016 1:31 pm
same result
CLI
Powershell script
ini
Code: Select all
Current Status: CRITICAL (for 2d 20h 29m 29s)
Status Information: CRITICAL: Memory for W3WP has passed 1,000 meg 194.66796875
Performance Data: Code: Select all
# ./check_nrpe -H g1vpfms02 -c check_w3wp -a '200 1000'
OK: Everything seems to be fine 194.72265625
Code: Select all
define service {
host_name G1VPFMS02
service_description W3WP Memory
check_command check_nrpe!check_w3wp!'200 1000'!!!!!!
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 5
first_notification_delay 0
notification_period xi_timeperiod_24x7
notification_options w,c,u,
contacts My Name
register 1
} Code: Select all
param($warn, $crit)
$LastExitCode = 3
$output = ""
$myW3WP = Get-Process w3wp | Sort -Descending WS| select -first 1 | Measure-Object WS -Sum
$myW3WP = $myW3WP.sum / 1mb
if ($myW3WP -gt $crit)
{
$output = "CRITICAL: Memory for W3WP has passed 1,000 meg $myW3WP"
$LastExitCode = 2
}
elseif ($myW3WP -gt $warn)
{
$output = "WARN: Memory for W3WP is getting close to 1,000 meg $myW3WP"
$LastExitCode = 1
}
else
{
$output = "OK: Everything seems to be fine $myW3WP"
$LastExitCode = 0
}
Write-Host $output
exit $LastExitCodeCode: Select all
[/settings/external scripts/scripts]
check_w3wp=cmd /c echo C:\scripts\checkW3WP.ps1 $ARG1$; exit $LastExitCode | powershell.exe -command -