Files
Redflag/docs/4_LOG/December_2025/2025-12-17_AgentHealth_Scanner_Improvements.md

4.1 KiB

AgentHealth Scanner Improvements - December 2025

Status: COMPLETED

Overview

Improved scanner defaults, extended scheduling options, renamed component for accuracy, and added OS-aware visual indicators.

Changes Made

1. Backend Scanner Defaults (P0)

File: aggregator-agent/internal/config/subsystems.go Line: 79 Change: Updated Update scanner default interval from 15 minutes → 12 hours (720 minutes)

Rationale: 15-minute update checks were overly aggressive and wasteful. 12 hours is more reasonable for package update monitoring.

// Before
IntervalMinutes: 15,   // Default: 15 minutes

// After  
IntervalMinutes: 720,  // Default: 12 hours (more reasonable for update checks)

2. Frontend Frequency Options Extended (P1)

File: aggregator-web/src/components/AgentHealth.tsx Lines: 237-238 Change: Added 1 week (10080 min) and 2 weeks (20160 min) options to dropdown

Rationale: Users need longer intervals for update scanning. Weekly or bi-weekly checks are appropriate for many use cases.

// Added to frequencyOptions array
{ value: 10080, label: '1 week' },
{ value: 20160, label: '2 weeks' },

3. Component Renamed (P2)

Files:

  • aggregator-web/src/components/AgentHealth.tsx (created)
  • aggregator-web/src/components/AgentScanners.tsx (deleted)
  • aggregator-web/src/pages/Agents.tsx (updated imports)

Change: Renamed AgentScanners → AgentHealth

Rationale: The component shows overall agent health (subsystems, security, metrics), not just scanning. More accurate and maintainable.

4. OS-Aware Package Manager Badges (P1)

File: aggregator-web/src/components/AgentHealth.tsx Lines: 229-255, 343 Change: Added dynamic badges showing which package managers each agent will use

Implementation: getPackageManagerBadges() function reads agent OS type and displays:

  • Fedora/RHEL/CentOS: DNF (green) + Docker (gray)
  • Debian/Ubuntu/Linux: APT (purple) + Docker (gray)
  • Windows: Windows Update + Winget (blue) + Docker (gray)

Rationale: Provides transparency about system capabilities without adding complexity. Backend already handles OS-awareness via IsAvailable() - now UI reflects it.

ETHOS Compliance:

  • "Less is more" - Single toggle with visual clarity
  • Honest and transparent - shows actual system capability
  • No enterprise fluff - simple pill badges, not complex controls

5. Build Fix (P0)

File: aggregator-agent/internal/client/client.go Line: 580 Change: Fixed StorageMetricReport type error by adding models. prefix

// Before
func (c *Client) ReportStorageMetrics(agentID uuid.UUID, report StorageMetricReport) error

// After
func (c *Client) ReportStorageMetrics(agentID uuid.UUID, report models.StorageMetricReport) error

Rationale: Unblocked Docker build that was failing due to undefined type.

Technical Details

Supported Package Managers

Backend scanners support:

  • APT: Debian/Ubuntu (checks for apt command)
  • DNF: Fedora/RHEL/CentOS (checks for dnf command)
  • Windows Update: Windows only (WUA API)
  • Winget: Windows only (checks for winget command)
  • Docker: Cross-platform (checks for docker command)

Default Intervals After Changes

  • System Metrics: 5 minutes (unchanged)
  • Storage: 5 minutes (unchanged)
  • Updates: 12 hours (changed from 15 minutes)
  • Docker: 15 minutes (unchanged)

Testing

  • Docker build completes successfully
  • Frontend compiles without TypeScript errors
  • UI renders with new frequency options
  • Package manager badges display based on OS type

Future Considerations

  • Monitor if 12-hour default is still too aggressive for some use cases
  • Consider user preferences for custom intervals beyond 2 weeks
  • Evaluate if individual scanner toggles are needed (currently using virtual "updates" coordinator)
  • aggregator-agent/internal/config/subsystems.go - Backend defaults
  • aggregator-web/src/components/AgentHealth.tsx - Frontend component
  • aggregator-agent/internal/scanner/ - Individual scanner implementations