Skip to content

feat(msft-windows): add bluescreen (BSOD) alert monitor#106

Closed
Gumbees wants to merge 1 commit into
mainfrom
enhancement/bsod-alert
Closed

feat(msft-windows): add bluescreen (BSOD) alert monitor#106
Gumbees wants to merge 1 commit into
mainfrom
enhancement/bsod-alert

Conversation

@Gumbees

@Gumbees Gumbees commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

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):

  • Bug Check eventsMicrosoft-Windows-WER-SystemErrorReporting, Event ID 1001 ("the computer has rebooted from a bugcheck"). The authoritative BSOD signal; the message carries the stop code and dump path.
  • Minidump files — any *.dmp in %SystemRoot%\Minidump written 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 -Parameter defaulting to its $env: counterpart; no Read-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 the s2d-health-check monitor 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.)

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>

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Code review skipped — your organization's overage spend limit has been reached.

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.

@Gumbees

Gumbees commented Jun 25, 2026

Copy link
Copy Markdown
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.

@Gumbees Gumbees closed this Jun 25, 2026
@Gumbees
Gumbees deleted the enhancement/bsod-alert branch June 25, 2026 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant