mirror of
https://github.com/fleetdm/fleet
synced 2026-04-21 13:37:30 +00:00
Add battery capacity ratio check (#43758)
Extend the battery-health-check SQL to flag batteries whose max_capacity / designed_capacity is below 80%. The new clause guards against zero capacities and casts max_capacity to REAL for proper floating-point division, improving detection of degraded batteries in the macOS policy.
This commit is contained in:
parent
3dbe90a1b6
commit
18c35e3a54
1 changed files with 2 additions and 0 deletions
|
|
@ -4,6 +4,8 @@
|
|||
SELECT 1 FROM battery
|
||||
WHERE condition IN ('Service Needed', 'Permanent Failure')
|
||||
OR health IN ('Fair', 'Poor')
|
||||
OR (max_capacity > 0 AND designed_capacity > 0
|
||||
AND CAST(max_capacity AS REAL) / designed_capacity < 0.80)
|
||||
);
|
||||
critical: false
|
||||
description: >-
|
||||
|
|
|
|||
Loading…
Reference in a new issue