Add Ceph check

This commit is contained in:
Joshua Boniface 2023-02-16 16:13:09 -05:00
parent 11e8af995c
commit 34af6145b1
2 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,24 @@
#!/bin/bash
# Ceph check for Check_MK
# Installed by PVC ansible
CMK_VERSION="2.1.0"
USER=client.admin
KEYRING=/etc/ceph/ceph.client.admin.keyring
if [ -n "$USER" ] && [ -n "$KEYRING" ]; then
CEPH_CMD="ceph -n $USER --keyring=$KEYRING"
echo "<<<ceph_status>>>"
$CEPH_CMD -s -f json-pretty
if OUT="$($CEPH_CMD df detail --format json)"; then
echo "<<<ceph_df_json:sep(0)>>>"
$CEPH_CMD version --format json
echo "$OUT"
else
# fallback for old versions if json output is not available
echo "<<<ceph_df>>>"
$CEPH_CMD df detail
fi
fi

View File

@ -638,6 +638,7 @@
mode: 0755
with_items:
- backup
- ceph
- cephfsmounts
- dpkg
- entropy