Werk #17218: diskspace: IndexError: string index out of range

Component Site management
Title diskspace: IndexError: string index out of range
Date Dec 9, 2024
Level Trivial Change
Class Bug Fix
Compatibility Compatible - no manual interaction needed
Checkmk versions & editions
2.4.0b1 Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk Cloud (CCE), Checkmk MSP (CME)
2.3.0p23 Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk Cloud (CCE), Checkmk MSP (CME)

If the OMD_ROOT was located on a filesystem, which started with a character other than '/', then diskspace plugin would failwith the error:

File "/omd/sites/monitor/bin/diskspace", line 166, in _get_free_space
  if filesystem[0] == "/":
IndexError: string index out of range

This crash has been fixed. The call to df -P -B1 was replaced with a direct call to os.statvfs.

To the list of all Werks