Skip to content

Conversation

@mniedermaier
Copy link
Owner

Summary

  • Integrated host network statistics directly into landing container
  • Added comprehensive system monitoring page with real-time stats and historical data
  • Landing container now runs with host network mode on port 80

Changes

Container Architecture:

  • Removed host-stats container from both production and dev compose files
  • Updated landing container to use network_mode: host instead of bridge networking
  • Landing now accessible directly on port 80 (no port mapping needed)
  • Removed build step for host-stats from build.sh

Landing Application (software/landing/):

  • Integrated psutil to collect host network stats directly (filtering Docker interfaces)
  • Added background threads for collecting system and Docker container statistics
  • Changed Flask port from 8081 to 80
  • Added new API endpoints:
    • /api/stats - Current system statistics (CPU, memory, swap, disk, network, Docker containers)
    • /api/stats/history - Historical data for the past hour
  • Added new /stats route with comprehensive monitoring dashboard

System Stats Page (software/landing/templates/stats.html):

  • Real-time system metrics: CPU, Memory, Swap, Disk, Network I/O
  • System uptime display
  • Historical charts (1 hour) for CPU, Memory/Swap, Disk, and Network traffic
  • Service monitoring for OpenPLC, FUXA, and Virtual Hardware IO
  • Docker container statistics with CPU, memory, and network usage per container
  • Auto-refresh every 1 second for current stats, charts update every 10 seconds

Bug Fixes:

  • Fixed network traffic historical data spike on startup by initializing counters with current values
  • Memory chart now includes swap usage as a second line

Other Changes:

  • Fixed hardware abstraction in hwio-virtual to use NiceGUI properly with async updates
  • Updated landing page navigation to include link to stats page
  • Moved CTF reset button position for better UX

Test Plan

  • Verify landing page accessible on http://localhost after compose up
  • Check stats page displays real-time system metrics
  • Confirm historical charts populate correctly without initial spike
  • Validate Docker container stats show CybICS containers only
  • Test service monitoring for OpenPLC, FUXA, and VHIO

@mniedermaier mniedermaier self-assigned this Oct 11, 2025
@mniedermaier mniedermaier added the enhancement New feature or request label Oct 11, 2025
Copy link
Owner Author

@mniedermaier mniedermaier left a comment

Choose a reason for hiding this comment

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

Looks good

@mniedermaier mniedermaier merged commit fe54880 into main Oct 12, 2025
10 checks passed
@mniedermaier mniedermaier deleted the testbed-stats branch October 12, 2025 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants