6 Commits
Author SHA1 Message Date
jaredandClaude Opus 4.8 48d4474c20 fix: gate CPU tickets on sustained 15-min load, not transient spikes
Lint / Python (flake8) (push) Successful in 1m13s
Security / Python Security (bandit) (push) Successful in 37s
Test / Python Tests (pytest) (push) Successful in 41s
Lint / Notify on failure (push) Has been skipped
Lint / Python (flake8) (pull_request) Successful in 30s
Security / Python Security (bandit) (pull_request) Successful in 1m14s
Test / Python Tests (pytest) (pull_request) Successful in 43s
Lint / Notify on failure (pull_request) Has been skipped
_check_cpu_usage took a single 1-second psutil sample per run, so a momentary
spike raised a CPU ticket -- and because the ticket API reopens a closed ticket
on a matching alert, the same CPU ticket flapped open/closed on every hourly run.

Ticketing is now gated on the 15-minute load average normalized per core (a true
"sustained" signal): a transient spike barely moves the 15-min load, so it no
longer raises or reopens a ticket. The instantaneous percentage is still reported
(dry-run summary + description) and the measured sustained load is shown in the
ticket description; the title stays value-free so it doesn't churn each run. Falls
back to the instantaneous sample only if os.getloadavg() is unavailable.
Adds 5 regression tests.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-15 17:32:34 -04:00
jaredandClaude Opus 4.8 0feac1746d fix: show LXC storage in --dry-run summary
Lint / Python (flake8) (push) Successful in 57s
Security / Python Security (bandit) (push) Successful in 59s
Test / Python Tests (pytest) (push) Successful in 46s
Lint / Notify on failure (push) Has been skipped
Lint / Python (flake8) (pull_request) Successful in 34s
Security / Python Security (bandit) (pull_request) Successful in 34s
Test / Python Tests (pytest) (pull_request) Successful in 1m33s
Lint / Notify on failure (pull_request) Has been skipped
The LXC storage check runs in every mode, but its results were never
printed in the --dry-run summary, so a --dry-run appeared to skip LXC
storage entirely. Add an "LXC Storage:" section to the summary
(per-container usage %, a warning flag over the LXC_WARNING threshold, and
the issue count) via a small, testable helper `_format_lxc_dry_run()`.
Adds 4 regression tests.

Closes #23
Ref: #23

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-15 16:59:05 -04:00
jaredandClaude Opus 4.8 2c6b8c1294 fix: stop false-positive [hardware] tickets in a redundant Ceph fleet
Lint / Python (flake8) (push) Successful in 38s
Security / Python Security (bandit) (push) Successful in 39s
Test / Python Tests (pytest) (push) Successful in 51s
Lint / Notify on failure (push) Has been skipped
Lint / Python (flake8) (pull_request) Successful in 1m22s
Security / Python Security (bandit) (pull_request) Successful in 36s
Test / Python Tests (pytest) (pull_request) Successful in 44s
Lint / Notify on failure (pull_request) Has been skipped
Two monitoring-logic fixes so hwmonDaemon stops raising spurious hardware
tickets on a Ceph-backed cluster with PBS backups:

- _check_system_drive_indicators: count dmesg Buffer I/O / block errors
  per-line and skip non-physical / network-backed devices (Ceph RBD, dm-,
  loop). RBD Buffer I/O errors are storage-connectivity events (e.g. a Ceph
  mon-session blip), not local drive faults, so they must not raise a
  CRITICAL drive alert. Consistent with the existing _is_physical_disk
  exclusion. (Fired a false "CRITICAL: Buffer I/O errors (75 occurrences)"
  ticket where all 75 were on rbd devices.)

- _get_attribute_thresholds: drop the Power_On_Hours warning/critical
  threshold. Drive age alone is not a failure; with 2-3x Ceph redundancy
  and PBS backups we run drives to hard-failure rather than replace on age.
  The value is still recorded (history/description/new-drive logic) but no
  longer generates a ticket. Real failure-predictors (reallocated/pending/
  uncorrectable/CRC, self-test, trends) are unchanged.

Adds 7 regression tests (TestSystemDriveIndicators, TestAttributeThresholds).
All 98 tests pass; flake8 clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-15 15:20:49 -04:00
jaredandClaude Sonnet 4.6 823ff18890 test: expand test coverage for manufacturer profiles and ticket classification
Lint / Python (flake8) (push) Successful in 1m14s
Test / Python Tests (pytest) (push) Successful in 1m29s
Lint / Notify on failure (push) Has been skipped
Security / Python Security (bandit) (push) Failing after 11m40s
Add 42 new tests covering _get_manufacturer_profile (Seagate/WD/Samsung/Toshiba/
OOS/Ridata/unknown), _should_monitor_attribute, _get_attribute_thresholds,
_get_issue_type, _get_impact_level, and _categorize_issue.

Toshiba MG08 prefix matching and the raised High_Fly_Writes/Command_Timeout
thresholds introduced in the previous commit are now covered by tests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-25 19:52:59 -04:00
jaredandClaude Sonnet 4.6 5ce5593f4a fix: resolve flake8 E402/F401 in test file
Lint / Python (flake8) (push) Successful in 42s
Test / Python Tests (pytest) (push) Successful in 55s
Lint / Notify on failure (push) Has been skipped
Security / Python Security (bandit) (push) Successful in 46s
- Remove unused MagicMock import (F401)
- Move sys.path.insert above third-party imports and add noqa: E402
  to the two imports that must follow it (E402)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 10:28:29 -04:00
jaredandClaude Sonnet 4.6 78691e6235 ci: add notify-failure, pytest with coverage, and 49 unit tests
Lint / Python (flake8) (push) Failing after 20s
Security / Python Security (bandit) (push) Successful in 25s
Test / Python Tests (pytest) (push) Successful in 57s
Lint / Notify on failure (push) Successful in 2s
- lint.yml: add notify-failure Matrix alert job
- test.yml: new workflow running pytest with pytest-cov for coverage
- .coveragerc: omit tests and site-packages from coverage
- .gitignore: ignore __pycache__ and .pyc files
- tests/test_hwmon.py: 49 unit tests covering SystemHealthMonitor
  (temperature parsing, service monitoring, disk usage, metric collection,
  dry run behaviour); uses unittest.mock to isolate from env/filesystem

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 16:25:23 -04:00