Commit Graph
909 Commits
Author SHA1 Message Date
nicolargo d80553029e Add raid/smart/wifi/ip plugins 2026-07-13 19:22:21 +02:00
nicolargo 2521617163 Add global mean option 2026-07-13 10:34:39 +02:00
nicolargo 714c1c56a6 Migrate sensors plugin 2026-07-11 17:53:20 +02:00
nicolargo 57969218b7 Add GPU/NPU plugins 2026-07-05 11:47:16 +02:00
nicolargo a6c1c419ea Implement phase v2: Add qucklook plugin and responsive design for TUI 2026-06-20 19:49:28 +02:00
nicolargo 7a65950b99 Update Glances v5 architecture with latest Cyber Adv 2026-06-20 09:34:17 +02:00
nicolargo 9ee229d069 Merge branch 'develop' into develop-v5 2026-06-14 09:34:57 +02:00
nicolargo 988cad6847 version 4.5.5 2026-06-13 15:35:04 +02:00
nicolargo fc911f8543 Prepare Glances for release 2026-06-13 15:30:51 +02:00
Gabriel St. AngelandClaude Opus 4.8 3107c6ac51 feat(gpu): support NVIDIA Jetson (Tegra) integrated GPU via sysfs fallback
On Jetson (Tegra) the integrated GPU is enumerated by NVML
(nvidia-l4t-nvml) and reports its name (e.g. "Orin (nvgpu)"), but the
per-metric NVML queries return NVML_ERROR_NOT_SUPPORTED, so the GPU
plugin only ever showed N/A for proc/mem/temperature.

Add a Tegra sysfs backend (glances/plugins/gpu/cards/tegra.py) and wire
it into the NVIDIA card as a per-metric fallback: when NVML returns None
for a device detected as Tegra (name contains "nvgpu", or the Tegra GPU
sysfs node exists), read:

- proc:        /sys/devices/platform/gpu.0/load  (per-mille -> percent)
- temperature: the gpu-thermal /sys/class/thermal zone (milli-C -> C)

Memory stays N/A by design: the Tegra GPU shares system RAM, already
reported by the MEM plugin. Scales verified against tegrastats
(GR3D_FREQ and gpu@).

Adds unit tests with committed sysfs fixtures, a NEWS.rst entry and a
docs note.

Verified on JetPack 6.2.1 (L4T R36.4.7) and JetPack 7.2 (L4T R39.2):
identical sysfs node layout and gpu-thermal zone selection on both, with
temperature cross-checked against tegrastats on each.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-07 06:59:59 +00:00
nicolargo ee24b03742 feat(v5): TUI separator rule between header and top row (─ default, [outputs] separator)
Mirror v4: a horizontal rule now sits between the header line (system/uptime)
and the top row, in addition to the existing top↔body rule. Both use the ─
box-drawing glyph by default (v4 paints curses.ACS_HLINE). The [outputs]
separator config key (default True) governs both; when False the rule rows
are left blank rather than collapsed, preserving the vertical rhythm.
2026-06-06 19:19:39 +02:00
nicolargo ca1e96d312 docs(v5): G1 — mark trivials migrated in TUI catalogue + registry integration test
Add end-to-end test asserting that uptime/system/now appear in the TUI
registry while core/version/psutilversion are discovered (REST-served)
but filtered out of TUI rendering. Add system/uptime/now sections to
the tui-v4-rendering-patterns.md catalogue with v4 layout notes and v5
source pointers.
2026-06-06 18:03:30 +02:00
nicolargo 81b3fb677a Merge branch 'develop' into develop-v5 2026-06-06 14:50:42 +02:00
nicolargo 6d72447181 Update docs 2026-06-06 14:50:00 +02:00
nicolargo 813a4ec99b Arbitrary file write and command execution via redirection and chaining operators in AMP command configuration - GHSA-3vwc-qwhc-3mj7 - CVE-id-tbd 2026-06-06 08:24:14 +02:00
nicolargo 23ffad1b64 Merge branch 'develop' into develop-v5 2026-05-23 19:45:17 +02:00
nicolargo 07080cdca4 Update WebUI, requirements and docs 2026-05-23 15:42:02 +02:00
nicolargo 0de3b8f875 XML-RPC Multi-Origin CORS Configuration Silently Falls Back to Wildcard - CVE-2026-46608 2026-05-23 11:40:20 +02:00
nicolargoandClaude Opus 4.7 4976bd7509 docs(quickstart): document xmlrpc_allowed_hosts DNS rebinding protection
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-23 09:56:46 +02:00
nicolargoandClaude Opus 4.7 8b6cab83e8 docs(plan): implementation plan for GHSA-w856-8p3r-p338 XML-RPC fix
11-task TDD plan covering test scaffold, regression baseline,
parse_request Host validation, wildcard/port/missing-Host edge
cases, startup warning, conf entry, docs and lint/format check.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-23 09:43:23 +02:00
nicolargoandClaude Opus 4.7 bcbeae7af6 docs(spec): design for GHSA-w856-8p3r-p338 XML-RPC Host validation
Design document for CVE-2026-46611 patch: add opt-in Host header
validation to the XML-RPC server via a new xmlrpc_allowed_hosts
config key, with permissive default and startup warning (mirrors
the REST/WebUI mitigation pattern).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-23 09:38:43 +02:00
Nicolas Hennion 2cfc64e8e9 Update MCP configuration instructions in mcp.rst
Added instructions for configuring Glances MCP from the Claude command line.
2026-05-21 17:18:50 +02:00
nicolargoandClaude Opus 4.7 80c20863d9 feat(v5): categorical thresholds + processlist VIRT/RES/IO + bold cmd
Three orthogonal improvements bundled under the processlist v5 surface:

1) Categorical thresholds (framework-level)
   - thresholds_v5 grows compute_level_categorical + read_thresholds_categorical:
     value-set membership instead of numeric comparison. Walked
     most-severe-first so misconfigured overlaps escalate to the higher
     bucket. Unmatched values return "ok" (v4 parity).
   - base_v5._compute_levels_for_item dispatches on schema flag
     ``threshold_type: "categorical"``; numeric path unchanged.
   - 8 new threshold unit tests (incl. CSV parsing, whitespace, pk-prefix).

2) processlist status + nice as categorical fields
   - status (R/W/Z/D/...) and nice (-20..19) become watched with
     ``threshold_type: "categorical"``, no defaults — operators opt in:
       [processlist]
       status_ok=R,W,P,I
       status_critical=Z,D
       nice_warning=-20,...,-1,1,...,19
     Without configuration: no _levels entry (no false positives).

3) processlist renderer: VIRT/RES + R/s/W/s + bold cmd
   - Adds VIRT (memory_info.vms) and RES (memory_info.rss) columns.
   - Adds R/s and W/s columns computed from io_counters
     ([r_new, w_new, r_old, w_old, io_tag]) / time_since_update;
     io_tag != 1 renders "?" (access denied or first cycle).
   - Status / nice cells inherit categorical _levels colour.
   - Command rendering ports v4 split_cmdline:
     /usr/bin/python3 myscript.py
       → "/usr/bin/" + **"python3"** + " myscript.py"
     Kthreads (empty cmdline) keep the [name] fallback.

v4 catalogue updated accordingly. Suite v5: 1370+30 green, lint clean.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 17:30:01 +02:00
nicolargoandClaude Opus 4.7 645527de06 feat(v5): G4-processlist — port processcount + processlist plugins to v5
Last MCP gap closure. Both plugins reuse the v4 glances_processes
singleton (no engine rewrite — strategy two-phase): processcount calls
engine.update() + get_count() each cycle, processlist consumes the
pre-sorted list via get_list(). KNOWN_V5_MISSING_PLUGINS shrinks to ().

- processcount: scalar with total / running / sleeping / thread /
  pid_max; TUI mirrors v4's "TASKS N (M thr), R run, S slp, O oth"
  header.
- processlist: collection PK=pid; minimal column set CPU% / MEM% / PID /
  USER / THR / NI / S / Command, top-20 rows. cpu_percent and
  memory_percent are watched (50/70/90, prominent=False — parity fs).
- Engine-internal fields (memory_info, cpu_times, io_counters, gids,
  time_since_update, key) flagged internal=True so MCP/export keep
  them but the generic TUI skips them.
- Out of scope (deferred to G5 with args/config plumbing): extended
  view, programs aggregation, filter UI, interactive sort.

41 new tests (14 model + 27 renderer), v4 catalogue updated, MCP gap
log + adapter docstring updated.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 14:01:59 +02:00
nicolargo 779dee82ab feat(v5): G4-diskio — port diskio plugin to v5 (collection)
Last entry of ``KNOWN_V5_MISSING_PLUGINS`` after this commit:
``("processlist",)``.

Model (``glances/plugins/diskio/model_v5.py``):
- Fields: disk_name (PK, string), read_count / write_count
  (rate, number, internal — exportable for IOPS consumers but
  not rendered), read_bytes / write_bytes (rate, bytespers, watched,
  ``prominent=False``, ``strict_thresholds=True``, NO default
  thresholds).
- Sustained disk traffic is host-specific (a DB server may stream
  MB/s by design) — alerts only fire when operators set
  ``read_bytes_warning=...`` per-disk or per-field in
  ``[diskio]``. ``strict_thresholds=True`` blocks the bare-``<level>``
  fallback (same pattern as memswap.sin/sout) so a legacy
  ``[diskio] careful=50`` cannot trigger spurious alerts.
- ``read_time``/``write_time`` and the derived ``read_latency`` /
  ``write_latency`` of v4 are not ported — deferred with the
  ``--diskio-latency`` mode.
- ``psutil.disk_io_counters()`` may raise or return ``None`` on
  platforms without disk I/O support — model returns ``[]`` rather
  than crashing.

Renderer (``glances/plugins/diskio/render_curses_v5.py``):

    DISK I/O              R/s     W/s
    nvme0n1               0B      0B
    sda                   1.4M   732K

- 3-cell rows, 18 + 1 + 7 + 1 + 7 = 34 chars (fits sidebar cap).
- Sorted by disk_name. Cycle-1 disks (no rate baseline) are skipped
  entirely — no ``-`` placeholder wall on startup.
- Rate cells display ``auto_unit(bytes_per_sec)`` WITHOUT a trailing
  ``/s`` — header carries the per-second semantic (v4 parity).
- Long disk names tail-truncated with leading underscore.

Adjacent:
- ``KNOWN_V5_MISSING_PLUGINS`` shrinks to ``("processlist",)``.
- ``test_attach_mcp_logs_known_v5_gaps`` updated.
- v4 catalogue grows a ``## diskio`` section + ✅ footer.

28 new tests (13 model + 15 renderer). Full v5 suite: 762 passed.
2026-05-15 17:47:07 +02:00
nicolargo 1da7047688 Change default thresolds minimum duration for memswap 2026-05-15 17:11:47 +02:00
nicolargo f080a48937 feat(v5): G4-memswap — port the memswap plugin to v5 (scalar)
Sister of the v5 ``mem`` plugin. Same pattern, slimmer layout
(single-column body — v4 ``memswap.msg_curse`` does not 2-col).

Model (``glances/plugins/memswap/model_v5.py``):
- ``total`` / ``used`` / ``free`` — bytes, snapshot.
- ``percent`` — watched + prominent, default thresholds 50/70/90
  (same ladder as ``mem`` for UX consistency).
- ``sin`` / ``sout`` — cumulative in v4; v5 exposes them as
  bytes/sec via ``rate: True``.
- Tolerates platforms without a swap file (Illumos, OpenBSD —
  issues #1767, #2719): psutil raises, model returns ``{}`` so
  the scheduler tick keeps going.

Renderer (``glances/plugins/memswap/render_curses_v5.py``):

    SWAP   25.0%
    total  16.0G
    used    4.0G
    free   12.0G

- Line 1: ``SWAP`` (HEADER) + percent cell coloured by ``_levels.percent``.
  Title escalates to warning/critical when the prominent percent reaches
  those levels.
- Lines 2-4: ``total`` / ``used`` / ``free`` as label/value pairs.
- Value column floored at 6 chars so it does not jiggle between cycles.

Adjacent changes:
- ``KNOWN_V5_MISSING_PLUGINS`` in ``mcp_adapter_v5`` shrinks to
  ``processlist, fs, diskio`` — memswap no longer surfaces in the
  MCP startup gap log.
- v4 catalogue (``docs/architecture/tui-v4-rendering-patterns.md``)
  grows a ``## memswap`` section + ✅ footer pointing to the new
  renderer.

22 new tests (11 model + 11 renderer). Full v5 suite: 669 passed
(+22), lint clean.
2026-05-15 14:17:04 +02:00
nicolargo ebe0382252 docs(v5): G3-MCP Task 5 — conf + architecture §11 (MCP endpoint)
- ``conf/glances.conf``: add a commented ``[outputs] enable_mcp``
  entry above the existing ``mcp_path`` / ``mcp_allowed_hosts`` keys.
  Notes that the gate is off by default and that ``--enable-mcp``
  flips it via the config overlay.
- ``docs/architecture/glances-v5-architecture-decisions.md``: new
  §11 "MCP endpoint" covering:
  - §11.1 opt-in lifecycle (CLI + config)
  - §11.2 adapter architecture + flow diagram
  - §11.3 resource/prompt inventory with v5 status per entry
  - §11.4 known v5 gaps (logged on mount)
  - §11.5 alert schema (v5-native, no v4 translation — decision
    logged in the G3-MCP plan)
  - §11.6 auth (HTTP middleware passes SSE through; no special MCP
    middleware needed)
  - §11.7 DNS rebinding (independent ``mcp_allowed_hosts``)
  - §11.8 out of scope (history buffer, unported v4 plugins,
    WebSocket transport)
2026-05-15 13:58:30 +02:00
nicolargo 896eeca58f docs(v5): G3-MCP plan — port the MCP endpoint to v5 via an adapter
Plan covers 6 tasks: adapter, mount in webserver_v5 (gated by
[outputs] enable_mcp), CLI overlay propagation, explicit gap docs
(history + missing plugins), conf + architecture doc, final sweep.

Scope contract: do NOT rewrite GlancesMcpServer. Introduce a thin
McpStatsAdapter / McpPluginView in glances/outputs/mcp_adapter_v5.py
that exposes the v4-style stats interface (getPluginsList,
get_plugin(name), get_raw, get_limits, ...) over StatsStoreV5 +
plugin registry + GlancesAlerts.

Surfaces v5 gaps explicitly:
- no history → adapter returns {} + WARN log (1× per plugin);
- processlist/fs/diskio/memswap not in v5 → get_plugin returns None,
  MCP raises the canonical "Plugin not found" ValueError;
- auth+SSE: middleware must not buffer; verify or port v4
  GlancesMcpAuthMiddleware pattern.

Decision logged: alert schema = v5-native (option a, no v4 translation).
2026-05-15 12:08:07 +02:00
nicolargo 61fb09cdf9 docs(v5): G2 Task 5 — architecture §1.5 mode dispatch
- New §1.5 "Mode dispatch (CLI ↔ runtime)": alignment table, ASCII
  diagram of the assemble/serve branching, rationale (v4 mental model
  + remove unauthenticated default footgun), and open points (fate of
  --quiet/--no-tui, client mode).
- §1.4 (TUI thread): rephrased "CLI control" + "Shutdown" bullets to
  reflect that default mode no longer starts uvicorn.
- §4 (REST API): preamble notes the API server is now opt-in via -s;
  every subsection below applies to server mode exclusively.

MCP wiring is referenced as deferred to a dedicated G3-MCP plan
(consistent with Task 2 of G2 being dropped).
2026-05-15 11:26:52 +02:00
nicolargo 47c9d8241c chore(v5): G2 Task 4 — Makefile targets for the new mode dispatch
- ``run-v5``: TUI mode (the new default — help string updated to
  reflect it no longer binds a socket).
- ``run-v5-debug``: TUI mode + ``-d``.
- ``run-v5-server`` (new): REST API mode (``-s``), headless.
- ``run-v5-server-debug`` (new): REST mode + ``-d``.
- ``run-v5-mcp`` (new): REST + ``--enable-mcp``. The flag is accepted +
  validated today but the MCP mount is not yet wired into v5 — see the
  plan footer (Task 2 dropped, deferred to a dedicated G3-MCP plan).

Also updates the plan file: marks Task 2 (MCP gate) as DROPPED with a
rationale section explaining that MCP is not yet wired into v5
``webserver_v5``, so there is nothing to gate. The CLI flag + validation
shipped in Task 1 are kept; the actual mount + gate will land in
G3-MCP.
2026-05-15 11:25:39 +02:00
nicolargo f4417cdbba docs(v5): mark Phase 2 G1 per-plugin renderers in catalogue + NEWS
- Add a "✅ v5 renderer at ..." footer line under each migrated plugin
  section of the v4 TUI rendering catalogue (cpu, mem, load, network,
  percpu). Network + percpu footers also note which v4 modes are
  deferred to G2+ (--byte / --network-cumul / --network-sum and the
  quicklook-enabled toggle).
- New NEWS.rst entry for ``5.0.0a3 (Phase 2 G1)`` summarising the
  per-plugin renderer convention, the discovery mechanism, the new
  schema renderer hints (short_name / internal), and the visual-parity
  groundwork (prominent reverse pairs, 3-cycle alert warmup, top-row
  spacing, CPU/perCPU toggle, dynamic title color, psutil baseline guard).
2026-05-15 10:18:11 +02:00
nicolargoandClaude Opus 4.7 cbed074842 feat(v5): add short_name renderer hint (v4 parity)
Plugins can declare an optional short_name in fields_description for
compact label display in tight per-plugin renderers:

  ctx_switches.short_name = 'ctx_sw'
  soft_interrupts.short_name = 'sw_int'
  interrupts.short_name = 'inter'

A new field_label(schema, field_name, prefer_short=False) helper
encapsulates the resolution order:
  - prefer_short=True: short_name -> label -> field name
  - prefer_short=False (default, generic renderer): label -> field name

The cpu render_curses_v5 now pulls every column label via
field_label(..., prefer_short=True) instead of hardcoding labels.

Mirrors v4 short_name (cf. curse_add_stat in plugins/plugin/model.py).
Documented in architecture decisions section 3.2 and SKILL-plugin.md.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 16:07:10 +02:00
nicolargoandClaude Opus 4.7 cdf4515a9b docs(v5): add Phase 2 G1 plan — per-plugin renderers for mem/load/network/percpu
One commit per plugin, each replicating its v4 msg_curse layout. Each
task starts by reading the v4 source + catalogue (project memory rule
`feedback-tui-v5-must-mirror-v4`).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 14:45:59 +02:00
nicolargoandClaude Opus 4.7 d2d338fea6 docs(v5): document per-plugin render_curses_v5 convention
- SKILL-plugin.md: new section explaining when and how to write a
  per-plugin TUI renderer; pointers to cpu reference + v4 catalogue.
- architecture §1.4: per-plugin renderer documented as the escape hatch
  for layouts the generic table fallback cannot produce.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 14:44:01 +02:00
nicolargoandClaude Opus 4.7 b7d8cd1d37 feat(v5): TUI blocks render as aligned 2/N-col tables + filter internal fields
Two TUI corrections raised by the v4/v5 visual comparison:

1. Internal fields (time_since_update, cpucore) leaked into the UI. They
   are computation support (rate divisor, threshold normalizer) and
   should never be displayed. Introduces a new `internal: True` flag in
   the `fields_description` schema. Tagged:
   - time_since_update (base class, every plugin)
   - cpucore (cpu, load)

   The flag is rendering-only: the field still goes through the REST
   API and is available to `normalize_by` / `rate` computations.

2. Plugin blocks rendered as left/right cells with a fixed 1-space gap,
   which made cpu/mem/load blocks misaligned. Now:
   - scalar blocks: 2-column table (label left-aligned, value right-aligned)
   - collection blocks: N-column table (primary key left-aligned, rest right)
   Column widths auto-fit the widest content per block.

Docs:
- SKILL-plugin.md: `internal` added to renderer-hints table
- glances-v5-architecture-decisions.md §3.2: `internal` documented

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 22:23:46 +02:00
nicolargoandClaude Opus 4.7 9c653d1e3a docs(v5): flesh out §1.4 curses TUI integration
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 17:46:19 +02:00
nicolargo 5187a8d735 Add plan for Phase 2 / G0 2026-05-12 17:34:12 +02:00
nicolargo 6c6050dca8 docs(v5): document optional fields_description renderer hints (format, column_width) 2026-05-12 17:30:45 +02:00
nicolargoandClaude Sonnet 4.6 bd930568a3 docs(v5): document v4 msg_curse() patterns for the 5 Phase 1 plugins
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 17:26:40 +02:00
nicolargo aae4b68f6a Add phase 2 plan 2026-05-12 17:16:19 +02:00
nicolargo 15fbf5de58 Introduce min_duration_seconds per field for thresolds / Add a new main entry point for Glances v5 2026-05-12 13:28:14 +02:00
nicolargo 4d829d36c7 Add first route for API 2026-05-12 11:31:05 +02:00
nicolargo 35b4ba1416 Add first version of the new Wevserver for v5 (based on FastAPI 2026-05-12 10:55:14 +02:00
nicolargo 8f56d242cc Shell actions added to the scheduler 2026-05-11 18:00:27 +02:00
nicolargo 452395bff4 First version of network 2026-05-11 17:03:44 +02:00
nicolargo f443d8ae05 Implement CPU plugin v5 - Add normalize_by option to normalise a limit by another field (ex: load and ctx switch) 2026-05-06 18:30:50 +02:00
nicolargo 9ee4cdb64b Merge branch 'develop' into develop-v5 2026-05-05 08:52:44 +02:00
nicolargo 77131e745f Update doc for #1711 2026-05-05 08:52:20 +02:00
nicolargo ee1272c222 First implementation for Plugin v5: Load and Mem 2026-05-04 18:38:09 +02:00