Skip to content

Passing keyring to a cephadm volume for health check #87

Description

@bluikko

Trying to use the check_ceph_health script I hit an issue: the keyring is not passed to the cephadm container that runs the ceph command.

I do not know how this current implementation is supposed to be run but usually there would be an additional switch passed to cephadm that mounts the keyring from the host OS to the container as a volume, for example with:

cephadm shell -v /etc/ceph/client.nagios.keyring:/etc/ceph/client.nagios.keyring:z

Possibly the :z at the end of the volume specification would not work on a system without SELinux but I do not have any other than RPM systems to test with. In the example code this is not included since I couldn't test it on other systems.

The example I made is very simple, possibly it is not pretty but Python is not one of my favorites: bluikko/ceph-nagios-plugins@master...bluikko-cephadm-volume
It works on my system but since this was not included in the original implementation it makes me question how was the cephadm support supposed to work earlier. Usually (?) the container it runs would not include keyrings, to my knowledge.

I would like feedback on this before I make a PR.

Additionally running the script without adding the above patch fails at line 189 on Python 3.9 (the real error is about the missing keyring)...

TypeError: a bytes-like object is required, not 'str'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions