Update dsmon.sh
This commit is contained in:
10
dsmon.sh
10
dsmon.sh
@@ -149,7 +149,8 @@ CHECK(){
|
||||
for hostname in "${hostnames_sort[@]}"; do
|
||||
until [ $(ls /tmp/dscheck.*.running 2>/dev/null | wc -l) -lt 12 ]; do tmp=tmp; done
|
||||
# RUN_CHECK ${hostname} > /tmp/dscheck.${hostname}.results &
|
||||
unbuffer bash -c "/usr/local/bin/dsmon runcheck '${hostname}'" > /tmp/dscheck.${hostname}.results &
|
||||
# unbuffer bash -c "/usr/local/bin/dsmon runcheck '${hostname}'" > /tmp/dscheck.${hostname}.results &
|
||||
RUN_CHECK "$hostname" "/tmp/dscheck.${hostname}.results" &
|
||||
done
|
||||
[ "${1}" != "report" ] && echo -e "${idsCL[LightGreen]}Done${idsCL[Default]}\n"
|
||||
|
||||
@@ -217,7 +218,9 @@ mv /tmp/dscheck.${hostname}.running /tmp/dscheck.${hostname}.done
|
||||
}
|
||||
|
||||
RUN_CHECK(){
|
||||
hostname=${1}
|
||||
local hostname=${1}
|
||||
local outfile="$2"
|
||||
{
|
||||
touch /tmp/dscheck.${hostname}.running
|
||||
hostid=${host_ids[$hostname]}
|
||||
|
||||
@@ -326,7 +329,7 @@ RUN_CHECK(){
|
||||
# echo -e "${host_name[$hostid]} - (${host_ip[$hostid]})\n\n${DRIVE} : ${DRIVEINFO_FREE[$DRIVE]}GB out of ${DRIVEINFO_TOT[$DRIVE]}GB Free (${DRIVEINFO_FREEPER[$DRIVE]}%)\n\n$(date)" | mail -s "Free Space ${fs_status}: '${host_name[$hostid]}'" ${ALERT_EMAIL}
|
||||
SENDNOTICE "Free Space ${fs_status}: '${host_name[$hostid]}'" "${host_name[$hostid]} - (${host_ip[$hostid]})
|
||||
|
||||
${DRIVE} : ${DRIVEINFO_FREE[$DRIVE]}GB out of ${DRIVEINFO_TOT[$DRIVE]}GB Free (${DRIVEINFO_FREEPER[$DRIVE]})percent" ${fs_priority}
|
||||
${DRIVE} : ${DRIVEINFO_FREE[$DRIVE]}GB out of ${DRIVEINFO_TOT[$DRIVE]}GB Free (${DRIVEINFO_FREEPER[$DRIVE]})percent" ${fs_priority}
|
||||
fi
|
||||
|
||||
done
|
||||
@@ -347,6 +350,7 @@ ${DRIVE} : ${DRIVEINFO_FREE[$DRIVE]}GB out of ${DRIVEINFO_TOT[$DRIVE]}GB Free ($
|
||||
echo -e "${idsCL[Yellow]} ${host_name[$hostid]} is down${idsCL[Default]}"; echo
|
||||
fi
|
||||
mv /tmp/dscheck.${hostname}.running /tmp/dscheck.${hostname}.done
|
||||
} >> "$outfile"
|
||||
}
|
||||
|
||||
SETUPSSH(){
|
||||
|
||||
Reference in New Issue
Block a user