fix: correct zero-safe pathconf checks and connectivity prefix match

- Use `is not None` for pathconf values so 0 is not silently dropped
- Broaden connectivity prefix check to catch bare "connectivity" key

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-08 13:07:54 -04:00
parent ddd857173b
commit 6282077fe0
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -127,15 +127,15 @@ class FilesystemInfoPlugin(InfoPlugin):
try: try:
# Maximum filename length # Maximum filename length
max_name = os.pathconf(partition.mountpoint, 'PC_NAME_MAX') max_name = os.pathconf(partition.mountpoint, 'PC_NAME_MAX')
if max_name: if max_name is not None:
fs_info['maxfile'] = max_name fs_info['maxfile'] = max_name
except (OSError, ValueError): except (OSError, ValueError):
pass pass
try: try:
# Maximum path length # Maximum path length
max_path = os.pathconf(partition.mountpoint, 'PC_PATH_MAX') max_path = os.pathconf(partition.mountpoint, 'PC_PATH_MAX')
if max_path: if max_path is not None:
fs_info['maxpath'] = max_path fs_info['maxpath'] = max_path
except (OSError, ValueError): except (OSError, ValueError):
pass pass
+1 -1
View File
@@ -1556,7 +1556,7 @@ class ThresholdChecker:
for mp in host.alert_states: for mp in host.alert_states:
# connectivity.* and rtt are managed by the connection state # connectivity.* and rtt are managed by the connection state
# machine, not by threshold config — never purge them. # machine, not by threshold config — never purge them.
if mp == "rtt" or mp.startswith("connectivity."): if mp == "rtt" or mp.startswith("connectivity"):
continue continue
if self._find_threshold(configured, mp)[0] is not None: if self._find_threshold(configured, mp)[0] is not None:
continue continue