Update status.inc
This commit is contained in:
@@ -174,6 +174,11 @@ STATUS(){
|
|||||||
fi
|
fi
|
||||||
# echo "HERE: $checkhost - $checkhostssl"
|
# echo "HERE: $checkhost - $checkhostssl"
|
||||||
if [ "${checkhost}" != "false" ] && [ "${checkhostssl}" == "ok" ]; then
|
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}" != "check" ]; then
|
||||||
if ([ "${ST_ACTION}" == "report" ] && [ "${2}" == "email" ]) || [ "${ST_ACTION}" != "report" ]; then
|
if ([ "${ST_ACTION}" == "report" ] && [ "${2}" == "email" ]) || [ "${ST_ACTION}" != "report" ]; then
|
||||||
if [ "${NTYPE}" == "OFW" ]; then
|
if [ "${NTYPE}" == "OFW" ]; then
|
||||||
@@ -188,15 +193,15 @@ STATUS(){
|
|||||||
|
|
||||||
else
|
else
|
||||||
uptime=$(${NCMD} uptime -p)
|
uptime=$(${NCMD} uptime -p)
|
||||||
|
|
||||||
fi
|
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
|
else
|
||||||
echo -e "${idsCL[Default]}"
|
echo -e "${idsCL[Default]}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
DIVIDER false lightCyan
|
DIVIDER false lightCyan
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f ${NM_TMPFOLDER}/${nip}.down ]; then
|
if [ -f ${NM_TMPFOLDER}/${nip}.down ]; then
|
||||||
if [ -f ${NM_TMPFOLDER}/${nip}.sent ]; 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)
|
[ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user