Ceph health check reports CRITICAL /var/lib/nagios/cat-ceph-status.txt: does not exist in Jammy

Bug #2004603 reported by Juan Pablo Noreña
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
NRPE Charm
New
Undecided
Unassigned

Bug Description

Ceph health checks is reporting "CRITICAL /var/lib/nagios/cat-ceph-status.txt: does not exist"

The cron at /etc/cron.d/cat-ceph-health
*/5 * * * * root /usr/local/bin/collect_ceph_status.sh

with the following content
#!/bin/bash
# Copyright (C) 2014 Canonical
# All Rights Reserved
# Author: Jacek Nykis <email address hidden>

LOCK=/var/lock/ceph-status.lock
lockfile-create -r2 --lock-name $LOCK > /dev/null 2>&1
if [ $? -ne 0 ]; then
    exit 1
fi
trap "rm -f $LOCK > /dev/null 2>&1" exit

DATA_DIR="/var/lib/nagios"
if [ ! -d $DATA_DIR ]; then
    mkdir -p $DATA_DIR
fi
DATA_FILE="${DATA_DIR}/cat-ceph-status.txt"
TMP_FILE=$(mktemp -p ${DATA_DIR})

ceph status --format json >${TMP_FILE}

chown root:nagios ${TMP_FILE}
chmod 0640 ${TMP_FILE}
mv ${TMP_FILE} ${DATA_FILE}

results in error 127

root@juju-ceph-mon-0:/home/ubuntu# /bin/bash -x /usr/local/bin/collect_ceph_status.sh
+ LOCK=/var/lock/ceph-status.lock
+ lockfile-create -r2 --lock-name /var/lock/ceph-status.lock
+ '[' 127 -ne 0 ']'
+ exit 1

The charms are running in Jammy

ceph-mon 17.2.0 active 1 ceph-mon quincy/stable 109 no Unit is ready and clustered
nrpe active 1 nrpe stable 96 no Ready

Revision history for this message
Nobuto Murata (nobuto) wrote :

I thought we fixed it for Quincy channel, can you double check if you have this fix?
https://bugs.launchpad.net/charm-ceph-mon/+bug/1998163

Revision history for this message
Juan Pablo Noreña (jpablo-norena) wrote :

Thank you, I missed that fix. This is a duplicated bug.

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.