Update nodemgmt-scripts.sh

This commit is contained in:
2019-12-12 23:50:32 -06:00
parent 953e6328e0
commit 688f798548

View File

@@ -385,27 +385,25 @@ STATUS(){
for partition in "${partitions3[@]}"; do
if [ "${partition}" != "udev" ]; then
freespace=`${NCMD} df -hPBM ${partition} | awk '{print $4}' |tail -1|sed 's/M$//g'`
c=0; cw=50; spc=''
spc1=${cw}-${#partition}
until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done
echo -en " ${partition}$spc: "
echo -e "${idsCL[Green]}${freespace} MB${idsCL[Default]}"
if [ "${freespace}" -le "10000" ]; then
fs_status='warn'
fs_status_color='Yellow'
elif [ "${freespace}" -le "1000" ]; then
fs_status='error'
fs_status_color='Red'
fi
if [ "${ST_ACTION}" != "check" ]; then
c=0; cw=50; spc=''
spc1=${cw}-${#partition}
until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done
echo -en " ${partition}$spc: "
echo -e "${idsCL[Green]}${freespace} MB${idsCL[Default]}"
fi
fi
done
# ${NCMD} df -hBM | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{ print $5 " " $1 }' | while read output; do
# freespace=$(echo $output | awk '{ print $1}' | cut -d'%' -f1 )
# partition=$(echo $output | awk '{ print $2 }' )
# if [ "${ST_ACTION}" != "check" ]; then
# c=0; cw=22; spc=''
# spc1=${cw}-${#partition}
# until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done
# echo -en " ${partition}$spc: "
# echo -e "${idsCL[Green]}${freespace}${idsCL[Default]}"
# fi
# done
nid=`expr $nid + 1`
done
done