nagios_additional_checks not working with whitespaces

Bug #2037620 reported by Marcus Boden
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceph Monitor Charm
Fix Released
Medium
Luciano Lo Giudice
Quincy.2
Fix Released
Undecided
Luciano Lo Giudice

Bug Description

when defining nagios_additional_checks, spaces and escaping aren't set up correctly. I have the following:
$ juju config ceph-mon nagios_additional_checks
{'ceph_slow_requests': 'slow-requests', 'ceph_slow_ops': 'slow ops'}

Which results in the following failing check:
/usr/local/lib/nagios/plugins/check_ceph_status.py -f /var/lib/nagios/cat-ceph-status.txt --additional_check '"slow' 'ops"' --additional_check_critical

ubuntu@juju-e9cbb4-26-lxd-0:~$ sudo -u nagios /usr/local/lib/nagios/plugins/check_ceph_status.py -f /var/lib/nagios/cat-ceph-status.txt --additional_check '"slow' 'ops"' --additional_check_critical
usage: check_ceph_status.py [-h] [-f STATUS_FILE] [--degraded_thresh DEGRADED_THRESH] [--misplaced_thresh MISPLACED_THRESH] [--recovery_rate RECOVERY_RATE] [--raise_nodeepscrub] [--additional_check ADDITIONAL_CHECK] [--additional_check_critical] [--check_num_osds]
check_ceph_status.py: error: unrecognized arguments: ops"

I tried escaping it in different ways, but couldn't get it to work.

I'm using juju 2.9.44, the ceph-mon charm is on jammy, openstack version is yoga.

Revision history for this message
Luciano Lo Giudice (lmlogiudice) wrote :

This issue has been fixed in edge, but is still present on Quincy.

Changed in charm-ceph-mon:
assignee: nobody → Luciano Lo Giudice (lmlogiudice)
status: New → In Progress
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-ceph-mon (stable/quincy.2)

Reviewed: https://review.opendev.org/c/openstack/charm-ceph-mon/+/896840
Committed: https://opendev.org/openstack/charm-ceph-mon/commit/e669877589d929fab1b694e8d8004f07cac6ed04
Submitter: "Zuul (22348)"
Branch: stable/quincy.2

commit e669877589d929fab1b694e8d8004f07cac6ed04
Author: Luciano Lo Giudice <email address hidden>
Date: Thu Sep 28 19:04:19 2023 -0300

    Fix shell quoting (quincy)

    This patchset fixes shell quoting in generated NRPE commands. This
    is a backport for Quincy, since the fix is present on edge.

    Change-Id: I8cfae089fac048f17dfb98240a5f98f60d7e210b
    Closes-Bug: #2037620

Changed in charm-ceph-mon:
status: In Progress → Fix Committed
Changed in charm-ceph-mon:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.