Update status.inc
This commit is contained in:
@@ -72,14 +72,15 @@ STATUS(){
|
||||
lip=${RUN_NODE_IP}
|
||||
echo -e "\n$(DIVIDER)\n${idsCL[Yellow]}${idsST[Bold]} LOCALHOST Service Status${idsST[Reset]}${idsCL[Default]}"
|
||||
echo -e "$(DIVIDER)"
|
||||
echo -en " ${idsST[Bold]}${idsCL[LightCyan]}${NODE_HOSTNAME} (${lip})${idsST[Reset]}"
|
||||
echo -en " ${idsST[Bold]}${idsCL[LightCyan]}${NODE_HOSTNAME} ${idsST[Reset]}${idsCL[LightCyan]}[${lip}]"
|
||||
if ([ "${ST_ACTION}" == "report" ] && [ "${2}" == "email" ]) || [ "${ST_ACTION}" != "report" ]; then
|
||||
uptime=`uptime -p`
|
||||
echo -e "${idsCL[LightCyan]} - ${uptime} - ${idsCL[Yellow]}CPU: `IDS_NUMBER_FORMAT ${cpu_usage} 1`'%${idsCL[Default]}"
|
||||
echo -e "${idsCL[Yellow]}[CPU: `IDS_NUMBER_FORMAT ${cpu_usage} 1`'%]${idsCL[White]} - ${uptime}${idsCL[Default]}"
|
||||
else
|
||||
echo -e "${idsCL[Default]}"
|
||||
fi
|
||||
DIVIDER . green
|
||||
|
||||
fi
|
||||
# if [ "${ST_ACTION}" != "check" ]; then
|
||||
# lip=${RUN_NODE_IP}
|
||||
@@ -444,7 +445,6 @@ STATUS_NODE(){
|
||||
checkhost=true
|
||||
checkhostssl=ok
|
||||
fi
|
||||
# echo "HERE: $checkhost - $checkhostssl"
|
||||
if [ "${checkhost}" != "false" ] && [ "${checkhostssl}" == "ok" ]; then
|
||||
[ "${NODETYPE}" != "OFW" ] && cpu_usage=$(ssh -q -o ConnectTimeout=1 -o ConnectionAttempts=1 root@${nip} "/opt/idssys/defaults/get-data.sh cpu-usage") || cpu_usage=""
|
||||
|
||||
@@ -464,7 +464,7 @@ STATUS_NODE(){
|
||||
else
|
||||
uptime=$(${NCMD} uptime -p)
|
||||
fi
|
||||
[ "${ST_ACTION}" != "check" ] && echo -e "\r\033[K ${idsST[Bold]}${idsCL[LightCyan]}${NM_HOSTNAMES[${nip}]}${idsST[Reset]}${idsCL[Yellow]} [${nip}][CPU: `IDS_NUMBER_FORMAT ${cpu_usage} 1`'%]${idsCL[White]} - ${uptime}${idsCL[Default]}"
|
||||
[ "${ST_ACTION}" != "check" ] && echo -e "\r\033[K ${idsST[Bold]}${idsCL[LightCyan]}${NM_HOSTNAMES[${nip}]}${idsST[Reset]}${idsCL[LightCyan]} [${nip}]${idsCL[Yellow]}[CPU: `IDS_NUMBER_FORMAT ${cpu_usage} 1`'%]${idsCL[White]} - ${uptime}${idsCL[Default]}"
|
||||
else
|
||||
echo -e "${idsCL[Default]}"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user