Skip to content

Commit db846b1

Browse files
committed
22141 FIX nimble_volumes: Fix crash on volumes without monitoring data
Jira: CMK-37374 Crash-Group-ID: 4842 Latent-Since: I117714255a44857304c78a59e5c5fa5e042c8549 Change-Id: Ib4e361eef82c98376a4e9caf251d5e76319b08b7
1 parent 9b5c134 commit db846b1

4 files changed

Lines changed: 26 additions & 5 deletions

File tree

.werks/22141.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[//]: # (werk v2)
2+
# nimble_volumes: Fix crash on volumes without monitoring data
3+
4+
key | value
5+
---------- | ---
6+
date | 2026-08-07T09:04:47.621844+00:00
7+
version | 2.4.0p36
8+
class | fix
9+
edition | cre
10+
component | checks
11+
level | 1
12+
compatible | yes
13+
14+
On some Nimble Storage arrays, the _Volume_ services crashed with
15+
16+
```
17+
ValueError: invalid literal for int() with base 10: ''
18+
```
19+
20+
Such arrays list volumes in their SNMP walk that carry no monitoring data at all.
21+
These volumes are now ignored.
22+
They are no longer discovered, and services that already exist for them will go stale.

cmk/base/legacy_checks/nimble_volumes.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ def _check_nimble_volumes(item, params, info, now):
3838

3939

4040
def parse_nimble_volumes(string_table: StringTable) -> StringTable:
41-
return string_table
41+
# Some entries don't contain any monitoring data: CMK-37374
42+
return [line for line in string_table if line[2] and line[3] and line[4]]
4243

4344

4445
check_info["nimble_volumes"] = LegacyCheckDefinition(

cmk/plugins/collection/checkman/nimble_volumes

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ item:
1212
Name of the volume
1313

1414
discovery:
15-
One service is created for each volume.
15+
One service is created for each volume. Volumes whose SNMP walk contains no
16+
size, usage or online data are ignored.

tests/unit/cmk/base/legacy_checks/test_nimble_volumes.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
# This file is part of Checkmk (https://checkmk.com). It is subject to the terms and
44
# conditions defined in the file COPYING, which is part of this source code package.
55

6-
import pytest
7-
86
from tests.unit.checks.checktestlib import mock_item_state
97

108
from cmk.base.legacy_checks.nimble_volumes import (
@@ -37,7 +35,6 @@ def test_check_ok_volume() -> None:
3735
assert ("fs_size", 1073741824, None, None, 0, None) in perfdata
3836

3937

40-
@pytest.mark.xfail(strict=True, reason="CMK-37374")
4138
def test_check_does_not_crash_on_empty_size_values() -> None:
4239
section = parse_nimble_volumes(STRING_TABLE)
4340
assert not list(

0 commit comments

Comments
 (0)