Werk #18022: multipath: fix division by zero crash

Component Checks & agents
Title multipath: fix division by zero crash
Date May 8, 2025
Level Trivial Change
Class Bug Fix
Compatibility Incompatible - Manual interaction might be required
Checkmk versions & editions
2.5.0b1
Not yet released
Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk Cloud (CCE), Checkmk MSP (CME)
2.4.0p3 Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk Cloud (CCE), Checkmk MSP (CME)
2.3.0p33 Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk Cloud (CCE), Checkmk MSP (CME)

The check plugin crashed with the error:

  File "/omd/sites/hpc/lib/python3/cmk/base/plugins/agent_based/multipath.py", line 213, in check_multipath
    num_active / num_paths * 100.0,
  ZeroDivisionError (division by zero)

This issue occurred when no paths were found in the output of the multipath -l command. The command’s output is influenced by the verbosity level, which is defined in the multipath.conf file and typically defaults to level 2. If this verbosity level is set to a lower value, the command may not display all available paths, potentially also causing the check plugin to crash.

To address this, we now explicitly invoke multipath -l -v2 within the agent.

This werk is considered incompatible because the agent must be re-deployed to utilize the updated command.

To the list of all Werks