diff --git a/CHANGELOG.md b/CHANGELOG.md index 60e7cff..03ac967 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ * (#3) Correct ((LINE++)) -> BASH with LINE=$((LINE+1)) -> SH * (#4) Add monitoring for Ceph Monitor (process and port). * (#4) Add monitoring for Ceph OSD (process and few ports). +* (#4) Add a basic monitoring for Ceph health (default username). --------------------------------------- diff --git a/templates/motd_fs_info.erb b/templates/motd_fs_info.erb index 7e9c5f6..cc6282a 100755 --- a/templates/motd_fs_info.erb +++ b/templates/motd_fs_info.erb @@ -20,7 +20,7 @@ WHITEB='\033[1;37m' RESET='\033[0m' -printf '%b' "${MAGENTA}++++++++++++++++++++: ${WHITE}Disk Usage${MAGENTA} :+++++++++++++++++++++${RESET}" +printf '%b' "${MAGENTA}++++++++++++++++++++: ${WHITE}Disk Usage${RESET} ${MAGENTA}:+++++++++++++++++++++${RESET}" # Root partition # Replace by rootfs in few kernel version DISK_USAGE=$(df | grep -m1 "/$" | awk '{print $5}') @@ -37,7 +37,7 @@ done ### IF ZFS if [ $(which zpool) ]; then - printf '%b' "\n${MAGENTA}+++++++++++++++++++ ${WHITEB}ZFS${RESET} ${WHITE}Partitions${MAGENTA} :++++++++++++++++++${RESET}" + printf '%b' "\n${MAGENTA}+++++++++++++++++++ ${WHITEB}ZFS${RESET} ${WHITE}Partitions${RESET} ${MAGENTA}:++++++++++++++++++${RESET}" NUMBER_PART=$(df -T | grep zfs | wc -l) LINE=1 @@ -51,6 +51,20 @@ if [ $(which zpool) ]; then fi ### FI ZFS +### IF CEPH +if [ -f /etc/ceph/ceph.conf ]; then + printf '%b' "\n${MAGENTA}++++++++++++++++++++++++ ${WHITEB}Ceph${RESET} ${MAGENTA}:++++++++++++++++++++++++${RESET}" + HEALTH=$(ceph health) + + if [ $? ]; then + printf '%b' "\n${MAGENTA}+ ${GREEN}${HEALTH}" + else + printf '%b' "\n${MAGENTA}+ ${REDB}${HEALTH}" + fi + +fi +### FI CEPH + printf '%b' "${RESET}\n"