
#!/bin/sh
## chk_filers.sh
#@ Maarten.deBoer@atos.net
#= Check filer connectivity via management-port

PGM="`basename $0|cut -d\. -f1`"
TMP="/tmp/${PGM}.$$"
LOG="${HOME}/log/${PGM}.log"
FILERS="${HOME}/etc/filers"
SSH="/usr/bin/ssh -n"

echo "`date` Start." | tee -a ${LOG}
for FILER in `cat $FILERS | grep -v \^#`
do
  echo "${FILER} ... " |tee -a ${TMP}
#  echo -n "`${SSH} ${FILER} hostname`:" | tee -a ${LOG}
#  ${SSH} ${FILER} uptime | tee -a ${LOG}| cut -d\, -f1
  ${SSH} ${FILER} vfiler status | grep running | grep omi >> ${TMP}

done
echo "`date` End." | tee -a ${LOG}

cat ${TMP}

rm ${TMP}
exit 0

