Skip to content

Commit 17870fe

Browse files
fdriesslerrelrod
authored andcommitted
ceph: Add default value for MK_CONFDIR
When the environment variable `$MK_CONFDIR` was not set, the ceph agent would crash with a KeyError. This has been fixed and the default directory is now `/etc/check_mk/`, consistent with other agents. CMK-32386 #894 Change-Id: I5f92426b17da95ec51125c8393334f7564af74cb
1 parent 0aea75c commit 17870fe

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

.werks/19869.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[//]: # (werk v3)
2+
# ceph: Fix agent crash when MK_CONFDIR is not set
3+
4+
key | value
5+
---------- | ---
6+
date | 2026-06-19T01:53:09.527671+00:00
7+
version | 3.0.0b1
8+
class | fix
9+
edition | community
10+
component | checks
11+
level | 1
12+
compatible | yes
13+
14+
When the environment variable `$MK_CONFDIR` was not set, the ceph agent would
15+
crash with a KeyError.
16+
17+
This has been fixed and the default directory is now `/etc/check_mk/`,
18+
consistent with other agents.

cmk/plugins/ceph/agents/mk_ceph.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def main() -> int:
141141
except ImportError:
142142
return _bail_out_missing_dependency()
143143

144-
ceph_config, ceph_client = _load_plugin_config(os.environ["MK_CONFDIR"])
144+
ceph_config, ceph_client = _load_plugin_config(os.getenv("MK_CONFDIR", "/etc/check_mk"))
145145

146146
cluster = RadosCMD(Rados(conffile=ceph_config, name=ceph_client))
147147
cluster.client.connect()

0 commit comments

Comments
 (0)