Update status.inc

This commit is contained in:
2023-12-04 19:55:53 -06:00
parent ab415aee64
commit 6aba14e208

View File

@@ -174,6 +174,11 @@ STATUS(){
fi
# echo "HERE: $checkhost - $checkhostssl"
if [ "${checkhost}" != "false" ] && [ "${checkhostssl}" == "ok" ]; then
[ "${NTYPE}" != "OFW" ] && cpu_usage=$(ssh -q -o ConnectTimeout=1 -o ConnectionAttempts=1 root@${nip} "/opt/idssys/defaults/get-data.sh cpu-usage") || cpu_usage=""
if [ "${ST_ACTION}" != "check" ]; then
if ([ "${ST_ACTION}" == "report" ] && [ "${2}" == "email" ]) || [ "${ST_ACTION}" != "report" ]; then
if [ "${NTYPE}" == "OFW" ]; then
@@ -188,15 +193,15 @@ STATUS(){
else
uptime=$(${NCMD} uptime -p)
fi
[ "${ST_ACTION}" != "check" ] && echo -e "\r\033[K ${idsST[Bold]}${idsCL[LightCyan]}${NM_HOSTNAMES[${nip}]} [${nip}]${idsST[Reset]}${idsCL[White]} - ${uptime} ${idsCL[LightYellow]}${LH}${idsCL[Default]}"
[ "${ST_ACTION}" != "check" ] && echo -e "\r\033[K ${idsST[Bold]}${idsCL[LightCyan]}${NM_HOSTNAMES[${nip}]} [${nip}]${idsST[Reset]}${idsCL[White]} - ${uptime} - CPU: ${cpu_usage}'% ${idsCL[LightYellow]}${LH}${idsCL[Default]}"
else
echo -e "${idsCL[Default]}"
fi
DIVIDER false lightCyan
fi
if [ -f ${NM_TMPFOLDER}/${nip}.down ]; then
if [ -f ${NM_TMPFOLDER}/${nip}.sent ]; then
[ -f ${NM_TMPFOLDER}/${nip}.errtime ] && toterrtime=`date +%s`-$(stat -c %Y ${NM_TMPFOLDER}/${nip}.errtime) || toterrtime=`date +%s`-$(stat -c %Y ${NM_TMPFOLDER}/${nip}.down)