fix: correct THRESHOLD_DEFAULTS metric keys and add missing defaults

- Rename memory_monitor threshold key from 'percent' to 'memory_percent'
  so it matches exactly rather than relying on suffix stripping, which was
  causing swap_percent to be evaluated against the memory threshold
- Add swap_percent default thresholds (warning: 40%, critical: 75%)
- Add zfs_monitor pool capacity default thresholds (warning: 80%, critical: 90%)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Andreas Wrede
2026-05-10 14:03:44 -04:00
parent 9e389736f8
commit ab0132a38d
+11 -3
View File
@@ -79,9 +79,13 @@ THRESHOLD_DEFAULTS = {
} }
}, },
'memory_monitor': { 'memory_monitor': {
'percent': { 'memory_percent': {
'warning': 85.0, 'warning': 85.0,
'critical': 95.0 'critical': 95.0
},
'swap_percent': {
'warning': 40.0,
'critical': 75.0
} }
}, },
'disk_monitor': { 'disk_monitor': {
@@ -109,11 +113,15 @@ THRESHOLD_DEFAULTS = {
'pools': { 'pools': {
'*': { '*': {
'status': { 'status': {
'warning': 1, 'warning': 1,
'critical': 2, 'critical': 2,
'operator': '>', 'operator': '>',
'hysteresis': 0.0, 'hysteresis': 0.0,
'display': 'ZFS pool {pool_name} is {health}' 'display': 'ZFS pool {pool_name} is {health}'
},
'capacity': {
'warning': 80.0,
'critical': 90.0,
} }
} }
} }