From 8d9c08c2fea124b44fe3561ef949d92157abe251 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Mon, 6 Nov 2023 08:25:29 -0600 Subject: [PATCH] update --- defaults.inc | 5 +---- inc/status.inc | 10 ++++++++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/defaults.inc b/defaults.inc index dabfbbce..3ce32914 100755 --- a/defaults.inc +++ b/defaults.inc @@ -45,12 +45,9 @@ if [ -f ${NM_FOLDER}/conf/defaults.local.inc ]; then NODETYPES=$(for k in "${!NM_NODETYPES[@]}"; do echo "${NM_NODETYPES["$k"]} ${k}"; done | sort -f | while read desc nmtype; do echo ${nmtype}; done) IFS=$'\n' NM_NODE_TYPES=(${NODETYPES}); unset IFS - - printf "[%s]\n" "${NM_NODE_TYPES[@]}" - + # printf "[%s]\n" "${NM_NODE_TYPES[@]}" for ntype in "${NM_NODE_TYPES[@]}"; do - echo "HERE: $ntype" arr ${ntype}_HOSTS arr ${ntype}_SERVICES_CHECK arr ${ntype}_DOCKERS_CHECK diff --git a/inc/status.inc b/inc/status.inc index ec101b39..93f81925 100755 --- a/inc/status.inc +++ b/inc/status.inc @@ -139,7 +139,7 @@ STATUS(){ DIVIDER; echo -e "${idsST[Reset]}" fi for nip in "${!var}"; do - [ "${ST_ACTION}" != "check" ] && echo -en " ${idsST[Bold]}${idsCL[LightCyan]}${NM_HOSTNAMES[${nip}]}[${nip}]${idsST[Reset]}" + [ "${ST_ACTION}" != "check" ] && echo -en " ${idsST[Bold]}${idsCL[LightCyan]}${NM_HOSTNAMES[${nip}]} [${nip}]${idsST[Reset]}" if [[ $(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1) == *"${nip}"* ]]; then NCMD=''; LH='- localhost' @@ -153,7 +153,13 @@ STATUS(){ if [ "${ST_ACTION}" != "check" ]; then #echo -en " ${idsST[Bold]}${idsCL[LightCyan]}${NM_HOSTNAMES[${nip}]}[${nip}]${idsST[Reset]}" if ([ "${ST_ACTION}" == "report" ] && [ "${2}" == "email" ]) || [ "${ST_ACTION}" != "report" ]; then - uptime=`${NCMD} uptime -p` + if [ "${NTYPE}" != "OFW" ]; then + uptime=$(${NCMD} uptime -p) + else + uptime=$(${NCMD} uptime | awk '{print $3}' | cut -d, -f1) + hr=$(echo $uptime | cut -d: -f1); min=$(echo $uptime | cut -d: -f2) + uptime="up ${hr} hours, ${min} minutes" + fi echo -e "${idsCL[LightCyan]} - ${uptime} ${idsCL[LightYello]}${LH}${idsCL[Default]}" else echo -e "${idsCL[Default]}"