91 Commits

Author SHA1 Message Date
csvke
a8023b3e4c RV1126BP-70: Add config, docs, and unit tests for MPP plugin
- Add [mpp] section to conf/glances.conf with disable=True
- Add docs/aoa/mpp.rst documentation page and index entry
- Add unit test test_026_mpp with Rockchip MPP test fixtures
2026-04-11 01:34:44 +08:00
nicolargo
f5f1c33a3c Prepare release 4.5.3 2026-03-29 16:41:48 +02:00
Jeongwoo Kim
5cf5d22d64 test(webui): mark pytest asserts as nosec for Codacy 2026-03-27 00:04:48 +09:00
Jeongwoo Kim
fe79aa43c5 test: silence pylint in template response regression tests 2026-03-27 00:01:05 +09:00
Jeongwoo Kim
0d0057c8c9 test(webui): add helper docstrings for Codacy 2026-03-26 23:36:26 +09:00
Jeongwoo Kim
25484125ee style(webui): wrap new lines for Codacy 2026-03-26 23:23:29 +09:00
Jeongwoo Kim
8a6284a66c fix(webui): support Starlette TemplateResponse signature changes 2026-03-26 23:02:44 +09:00
Nicolas Hennion
137dc03a11 Lint the code 2026-03-24 08:18:04 +00:00
Steve Kowalik
5badf71000 Use sys.executable in the testsuite
Rather than looking for a venv python executable, use the existing
sys.executable property to execute the modules required.
2026-03-24 11:19:11 +11:00
nicolargo
b6a694f38f Add export to ClickHouse #3320 2026-03-22 10:15:17 +01:00
Christian Rishøj
139506b109 #3480 add unit tests for LXD container engine
- TestLxdStatsFetcher: CPU delta, memory fallback, network loopback exclusion, thread lifecycle
- TestLxdExtensionGenerateStats: stopped/running instances, proxy device ports, image config
- TestLxdExtensionUpdate: running filter, all_tag, cluster node filter, cleanup of removed instances

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 19:09:44 +01:00
nicolargo
f3e94930e3 SQL Injection in DuckDB Export via Unparameterized DDL Statements - Correct CVE-2026-32611 2026-03-14 10:33:24 +01:00
nicolargo
5680a5da4a Command Injection via Process Names in Action Command Templates - Correct CVE-2026-32608 2026-03-14 09:52:12 +01:00
nicolargo
2abe8d8733 Central Browser Autodiscovery Leaks Reusable Credentials to Zeroconf-Spoofed Servers - Correct CVE-2026-32634 2026-03-14 09:33:37 +01:00
nicolargo
45b3164464 Improve docs and also add min/max/mean for CPU and load 2026-03-07 10:09:24 +01:00
Siddharth Doshi
e306ad24b6 feat(plugin): add generic mmm (min/max/mean) support in base plugin model
Introduce a generic Min/Max/Mean (mmm) mechanism at the plugin model level.

When a field in `fields_description` defines `'mmm': True`, the plugin
automatically generates and maintains the following derived fields:

  <field>_min
  <field>_max
  <field>_mean

The computation is handled in the base plugin model to ensure the
feature is reusable across all plugins. Mean is calculated as a
running mean, and min/max are updated on each refresh cycle.

This implementation:
- Keeps the feature opt-in per field
- Avoids hardcoding logic in individual plugins
- Maintains full backward compatibility
- Preserves existing API v4 response structure
- Ensures no regression in existing behavior

Unit tests have been added to validate correct field generation
and update behavior.
2026-03-01 17:34:33 +05:30
Siddharth Doshi
5248bec5ee Enhance the existing memory plugin to track runtime minimum and maximum memory usage percentage since Glances startup and expose these values through the existing /api/4/mem endpoint. 2026-02-28 14:30:31 +05:30
nicolargo
18fa740db7 Format and lint 2026-02-26 21:55:37 +01:00
Nicolas Hennion
c24d3de651 Merge pull request #3454 from Julietmgbole/json-improvement-b
Improve JSON serializer with comprehensive normalization and tests
2026-02-25 09:35:23 +01:00
SudeepMalipeddi
c188365b42 fix: guard args access in msg_curse across 9 plugins
Several plugins call msg_curse(args=None) with args defaulting to None,
but then access args attributes directly (e.g. args.diskio_iops) without
checking if args is None first, causing AttributeError in tests and any
caller that omits args.

Add `args and` guard before every args attribute access in msg_curse for:
- diskio (4 places)
- fs (2 places)
- network (6 places)
- processlist (7 places)
- processcount (1 place)
- system (1 place)
- load (1 place)
- containers (1 place)
- gpu (2 places)

Also fix TestDiskioPluginMsgCurse tests to call update_views() before
msg_curse() so views are populated before rendering.

Fixes #3429
2026-02-24 23:17:24 +05:30
Julietmgbole.t@gmail.com
c29b902c21 Improve JSON serializer and add comprehensive tests (28 passing) 2026-02-23 20:12:30 -06:00
nicolargo
dedc28cae6 Lint code 2026-02-21 21:27:39 +01:00
nicolargo
887feb0484 Update docs 2026-02-21 21:18:27 +01:00
nicolargo
ad1f18c657 Add documentation for MCP server 2026-02-21 20:57:00 +01:00
nicolargo
7b200f00fc Add MCP (Model Context Protocol) server support to the web server
Expose Glances system monitoring data to AI assistants via the Model
Context Protocol, mounted alongside the existing REST API.

New features:
- GlancesMcpServer (glances/outputs/glances_mcp.py): FastMCP-based server
  exposing 6 resources (glances://plugins, glances://stats,
  glances://stats/{plugin}, glances://stats/{plugin}/history,
  glances://limits, glances://limits/{plugin}) and 4 prompt templates
  (system_health_summary, alert_analysis, top_processes_report,
  storage_health).
- GlancesMcpAuthMiddleware: pure-ASGI middleware (SSE-safe, no body
  buffering) reusing the existing Basic Auth / JWT Bearer credentials.
- CLI flags --enable-mcp and --mcp-path; config-file keys enable_mcp
  and mcp_path under [outputs].
- 25 tests in tests/test_mcp.py covering SSE connectivity, all resources
  and prompts via the MCP client SDK, and the auth middleware unit tests.

The mcp package (>=1.0.0) is added as the new optional dependency group
[mcp] and included in [all].

Activation: glances -w --enable-mcp
             or [outputs] enable_mcp = true in glances.conf

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-21 20:20:34 +01:00
Ambika Patidar
ebd314dd92 Merge branch 'develop' into makefile-new 2026-02-17 23:46:22 +05:30
Ambika Patidar
d9275fa5b8 Fix the test 2026-02-17 23:44:44 +05:30
Ambika Patidar
1b143b985a Fix the flaky tests 2026-02-17 23:41:33 +05:30
Nicolas Hennion
4e34a298f7 Skip NPU test when plugin is disabled
Skip NPU test if plugin is disabled in configuration.
2026-02-09 10:01:45 +01:00
Ambika Patidar
4c92e1b6e6 test: Fix flaky tests (allow empty dicts for list plugins) 2026-02-07 12:22:07 +05:30
Ambika Patidar
64d0114b00 test: Fix flaky tests on AppVeyor 2026-02-07 01:37:23 +05:30
Ambika Patidar
5eb1f4b794 test: Fix linting issues and trailing whitespace 2026-02-07 00:55:14 +05:30
Ambika Patidar
645841d99a Added test cases for plugins 2026-02-06 17:51:37 +05:30
nicolargo
790bb70781 Ignore NPU test on Windows 2026-01-25 16:41:54 +01:00
nicolargo
83da3de1a7 Add freq information about NPU 2026-01-24 15:57:31 +01:00
Fabian Fleischer
7748003d8b Add CPU core number field to processlist 2026-01-22 12:49:10 +01:00
nicolargo
a3195463a0 Add system test for NATS exporter 2026-01-03 14:21:26 +01:00
nicolargo
b7c6cce373 First version ok. Log message should be removed. Code should be tested. 2025-12-30 19:04:07 +01:00
nicolargo
5d9593b393 Lint the code 2025-12-26 18:47:01 +01:00
nicolargo
f587b281c0 Catch error on ADM GPU plugin and Python 3.9 2025-12-20 15:33:17 +01:00
nicolargo
59d54b8e2b Correct issue with test on Python 3.9 2025-12-20 10:36:00 +01:00
nicolargo
50818213b1 What a sexy pre-commit config file ! 2025-11-22 18:48:13 +01:00
nicolargo
3de1a25305 Revert some change on hide zero feature (need additional tests 2025-11-16 11:32:21 +01:00
Chris Herrera
c70321c3fb Formatting changes from running make format 2025-11-16 10:43:46 +01:00
Chris Herrera
89c8fc125c Add unit test for split_esc 2025-11-16 10:43:46 +01:00
nicolargo
c0dad78189 Unittest now take into account the default glances.conf file 2025-11-10 10:53:52 +01:00
nicolargo
d9abfca7fb Remove test because it breaks the CI test 2025-11-10 10:27:13 +01:00
nicolargo
cb377055f2 Remove test because it breaks the CI test 2025-11-10 10:26:22 +01:00
nicolargo
b2e3ea283d Remove test because it breaks the CI test 2025-11-10 07:48:03 +01:00
nicolargo
afff3e2ba6 Add a simple unit test for get_alert 2025-11-09 17:27:00 +01:00