monitoring-script-debugging

Diagnose false RED and false GREEN signals in monitoring and audit scripts.

2|Updated Jan 2, 2026
One-click install
npx skills add https://github.com/ShineBreaker/Guix-configs --skill monitoring-script-debugging-shinebreaker
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: monitoring-script-debugging
Source: https://github.com/ShineBreaker/Guix-configs/tree/main/dotfiles/mutable/agents/hermes/.local/share/hermes/skills/devops/monitoring-script-debugging
Command: npx skills add https://github.com/ShineBreaker/Guix-configs --skill monitoring-script-debugging-shinebreaker

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Monitoring and healthcheck scripts often report numbers that feel wrong: inflated error counts, permanently red lights, or silently skipped checks. This Skill provides a systematic method to find and fix the parser bugs, counting pitfalls, and config-loader defects behind false RED and false GREEN signals before any results are reported. ## Core Features & Use Cases - Parser Bug Diagnosis: Fix lenient JSONC parsers that corrupt valid data, including string-aware block comment stripping, standard-parser-first fallback ordering, and broken trailing-comma regex character classes. - Counting Pitfall Correction: Distinguish per-line vs per-event counting, total vs unique signatures, and all-history vs rolling-window scans so thresholds compare the right quantities. - Silent Failure Detection: Catch YAML key drift, fallback config loaders that return wrong types, and fnmatch excludes anchored at the path start that leave monitors not actually monitoring. - Cross-Validation Probes: Verify any reported number with an independent shell pipeline; if script and cross-check differ by more than 10%, patch the script before reporting. - Use Case: An audit script reports 291 errors against a threshold of 5. Using this Skill, you discover the count includes every traceback frame line and weeks of history, fix it to count unique signatures in a 7-day window, and confirm the true value is 23 with an independent grep pipeline. ## Quick Start Ask the agent to debug why my healthcheck script reports 291 errors when the logs only show a handful of real failures, and cross-validate the count with an independent shell pipeline.

Frequently Asked Questions about monitoring-script-debugging

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I debug a monitoring script that reports false errors?▼

Cross-validate the reported number with an independent shell pipeline, such as grep plus a Python counter for unique exception types. If the script and cross-check differ by more than 10%, the script has a parser or counting bug that must be patched before reporting any results.

Why does my JSONC parser break valid JSON files?▼

Lenient parsers corrupt valid data when regex-based comment stripping matches /* or // inside JSON strings, such as URLs or glob paths. Fix it with string-aware character-by-character comment stripping and always try the standard json.loads parser first before falling back to lenient parsing.

How do I count errors in log files correctly?▼

Count unique error signatures rather than total matching lines, and count each traceback block once instead of every frame line. Use a rolling time window based on per-line timestamps so old failures age out, and normalize retry counters like (1/3)(2/3)(3/3) into a single signature.

Why does my healthcheck stay red after the problem is fixed?▼

A permanently red check usually scans the entire log history instead of a rolling window, so old failures never age out. Parse per-line timestamps, let untimestamped traceback lines inherit the previous line's timestamp, and count only entries within a window such as 7 days.

Why do multiple checks crash with the same TypeError?▼

Mass identical TypeErrors like '<=' not supported between float and str indicate one config loader bug, not many check bugs. Probe the loader output directly; fallback YAML parsers often fail to strip inline comments or parse flow and block lists, returning strings where numbers are expected.

Why does fnmatch not exclude nested directories?▼

fnmatch patterns are anchored at the start of the path, so references/** only matches paths beginning with references/. To exclude a directory at any depth, prefix the pattern with **/, for example **/references/** or **/node_modules/**.