feat(msft-windows): add bluescreen (BSOD) alert monitor#106
Closed
Gumbees wants to merge 1 commit into
Closed
Conversation
Lightweight RMM condition script (modeled on msft-windows-s2d-health-check): detects recent bluescreens and exits 1 so an RMM monitor can alert; exits 0 when clean. Unlike msft-windows-bsod-diagnostics, it needs no API key and does no AI analysis -- it just answers "did this machine bluescreen recently?". Detection within a configurable window ($LookbackDays / $env:LookbackDays, default 1): - Bug Check events (Microsoft-Windows-WER-SystemErrorReporting, Event ID 1001) -- the authoritative "rebooted from a bugcheck" signal, with stop code + dump path - Minidump files in %SystemRoot%\Minidump written within the window Written to the non-interactive param-or-env standard. Verified: parses clean and runs (exit 0 / no false positives) on a machine with no crash history. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
Code review is billed via overage credits. To resume reviews, an organization admin can raise the monthly limit at claude.ai/admin-settings/claude-code.
Once credits are available, push a new commit or reopen this pull request to trigger a review.
Contributor
Author
|
Folded into PR #105 (improvement/drop-rmm-variable) to keep all the script-library changes in one PR. The bsod-alert script is unchanged, just moved. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A lightweight RMM condition/monitor script that answers one question: did this machine bluescreen recently? Modeled on
msft-windows-s2d-health-check.ps1— it exits 1 when a bluescreen is detected (so an RMM result-code condition can alert) and 0 when clean.This is distinct from the existing
msft-windows-bsod-diagnostics.ps1, which needs an Anthropic API key and performs deep AI crash analysis. This one needs no key and does no analysis — it's just a fast monitor.Detection
Within a configurable window (
$LookbackDays/$env:LookbackDays, default 1 day):Microsoft-Windows-WER-SystemErrorReporting, Event ID1001("the computer has rebooted from a bugcheck"). The authoritative BSOD signal; the message carries the stop code and dump path.*.dmpin%SystemRoot%\Minidumpwritten within the window (catches crashes whose WER event was cleared).Standard
Written natively to the non-interactive param-or-env standard: every input is a
-Parameterdefaulting to its$env:counterpart; noRead-Host, no RMM/interactive mode checks.Verification
Parses clean (PowerShell AST) and runs read-only (
Get-WinEvent/Get-ChildItem). Tested on a machine with no crash history:exit 0, no false positives, on both a 1-day and 10-year window.Exit codes
exit 1= bluescreen found (alert),exit 0= clean — matching thes2d-health-checkmonitor pattern. (Note: this intentionally uses the exit code as the alert signal, which differs from verdict-producing scripts that exit 0 and write to a custom field.)