Add Ceph check

This commit is contained in:
Joshua Boniface 2023-09-01 15:42:29 -04:00
parent c2b576334f
commit 34d12ab423
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 mode: 0755
with_items: with_items:
- backup - backup
- ceph
- cephfsmounts - cephfsmounts
- dpkg - dpkg
- entropy - entropy