Skip to content

Commit 5ea2fbe

Browse files
committed
feat: add sensors collector
1 parent a69911d commit 5ea2fbe

7 files changed

Lines changed: 965 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Added
11+
12+
- **Sensors collector** — added a new built-in `sensors` category for temperature and hardware sensor monitoring
13+
- Collects temperatures directly from `/sys/class/hwmon/hwmon*/temp*_input` with optional `*_label`, `*_max`, and `*_crit` metadata
14+
- Collects ACPI and platform thermal zone temperatures from `/sys/class/thermal/thermal_zone*/temp`
15+
- Collects NVMe and storage device temperatures from `/sys/class/block/*/device/hwmon/*/temp*_input`
16+
- Falls back to `sensors -j` when direct sysfs reads are unavailable or insufficient
17+
- Collects GPU temperature and fan data from `nvidia-smi` when available
18+
- Summarizes key thermal data as `CPU`, `GPU`, `NVMe`, and fan RPM values in scan output
19+
- **Expanded collector test coverage** — added dedicated tests for the new sensors collector
20+
- Covers direct sysfs hwmon, thermal zone, and block-device sensor collection
21+
- Covers `lm-sensors` JSON fallback behavior when sysfs data is unavailable
22+
1023
---
1124

1225
## [0.2.5] - 2026-03-10
@@ -233,7 +246,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
233246

234247
| Version | Date | Highlights |
235248
|---------|------|------------|
236-
| Unreleased || |
249+
| Unreleased || Sensors collector and expanded collector tests |
237250
| 0.2.5 | 2026-03-10 | Security collector and documentation updates |
238251
| 0.2.4 | 2026-03-10 | Test suite expansion |
239252
| 0.2.3 | 2026-03-10 | Test suite bug fixes |

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# OptiSys
22

3-
**OptiSys** is a system profiler and diagnostics tool for Linux. It collects detailed information about hardware, kernel, drivers, services, packages, logs, and security posture, and presents it in a structured terminal output. Results can be exported to JSON or YAML for use with external tools or AI-assisted analysis.
3+
**OptiSys** is a system profiler and diagnostics tool for Linux. It collects detailed information about hardware, kernel, drivers, services, packages, logs, security posture, and thermal sensor data, and presents it in a structured terminal output. Results can be exported to JSON or YAML for use with external tools or AI-assisted analysis.
44

55
![Python](https://img.shields.io/badge/Python-3.10+-blue.svg)
66
![License](https://img.shields.io/badge/License-MIT-green.svg)
@@ -11,6 +11,7 @@
1111
## Features
1212

1313
- **Hardware profiling** — CPU, GPU, memory, disks, and network interfaces
14+
- **Temperature and sensor monitoring** — CPU, GPU, NVMe, thermal zones, fans, and voltage readings with sysfs-first collection
1415
- **Kernel information** — OS release, kernel version, and system parameters
1516
- **Driver analysis** — loaded kernel modules and driver status
1617
- **Service monitoring** — systemd unit health and status
@@ -64,7 +65,7 @@ optisys scan
6465
### Scan specific categories
6566

6667
```bash
67-
optisys scan -c hardware -c kernel
68+
optisys scan -c hardware -c sensors -c kernel
6869
```
6970

7071
### Export results
@@ -142,6 +143,7 @@ This prints recent scan IDs, timestamps, hostnames, tool versions, durations, an
142143
| Category | Description |
143144
|----------|-------------|
144145
| `hardware` | CPU, GPU, memory, disks, and network interfaces |
146+
| `sensors` | CPU, GPU, NVMe, thermal zone, fan, and voltage sensor telemetry |
145147
| `kernel` | OS release, kernel version, and system parameters |
146148
| `drivers` | Loaded kernel modules and driver status |
147149
| `services` | Systemd unit health and status |
@@ -245,6 +247,7 @@ See [PLUGINS.md](optisys/PLUGINS.md) for the full developer guide, `BaseCollecto
245247
│ Status │ Category │ Duration │ Key Info │
246248
├────────┼──────────────┼────────────┼──────────────────────────────────────────────┤
247249
│ ✓ │ hardware │ 49ms │ Intel Core i5-9400 · 15.5GB RAM · 1 GPU │
250+
│ ✓ │ sensors │ 12ms │ CPU: 52°C · GPU: 61°C · NVMe: 38°C · fans: 1200rpm │
248251
│ ✓ │ kernel │ 4ms │ Pop!_OS 24.04 LTS · kernel 6.18.7 · up 2.4h │
249252
│ ✓ │ drivers │ 5662ms │ 171 modules · GPU: nvidia · DKMS: 8 │
250253
│ ✓ │ services │ 564ms │ 163 units · active: 68 · failed: 1 │
@@ -270,6 +273,7 @@ Scan completed in 6595ms Cached to /home/user/.cache/optisys/latest.json Recor
270273
| Category | Commands |
271274
|----------|----------|
272275
| Hardware | `lscpu`, `lsblk`, `ip`, `nvidia-smi` |
276+
| Sensors | `sensors`, `nvidia-smi` *(direct sysfs reads are preferred and work without `lm-sensors`)* |
273277
| Kernel | `uname`, `sysctl` |
274278
| Drivers | `lspci`, `lsmod` |
275279
| Services | `systemctl` |

optisys/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""OptiSys — System profiler and diagnostics tool."""
22

3-
__version__ = "0.2.5"
3+
__version__ = "0.2.6"

optisys/collectors/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from optisys.collectors.logs import LogsCollector
1313
from optisys.collectors.packages import PackagesCollector
1414
from optisys.collectors.security import SecurityCollector
15+
from optisys.collectors.sensors import SensorsCollector
1516
from optisys.collectors.services import ServicesCollector
1617

1718
# ---------------------------------------------------------------------------
@@ -26,6 +27,7 @@
2627
PackagesCollector(),
2728
LogsCollector(),
2829
SecurityCollector(),
30+
SensorsCollector(),
2931
]
3032

3133
_BUILTIN_KEYS: frozenset[str] = frozenset(c.key for c in _BUILTIN_COLLECTORS)
@@ -83,6 +85,7 @@
8385
"PackagesCollector",
8486
"LogsCollector",
8587
"SecurityCollector",
88+
"SensorsCollector",
8689
# Plugin system helpers
8790
"get_registry",
8891
]

0 commit comments

Comments
 (0)