From 6aba14e208a556bfde5eb7c129046bb0f72e4b21 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Mon, 4 Dec 2023 19:55:53 -0600 Subject: [PATCH] Update status.inc --- inc/status.inc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/inc/status.inc b/inc/status.inc index 3e0c103d..c3e0826f 100755 --- a/inc/status.inc +++ b/inc/status.inc @@ -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)