
#!/bin/sh
# File  : do_filer_cmds.sh
# By    : MaartenDeBoer.nl, 090611. 111109
# Subject       : Send some command to all filers (with FILTER)

PGM="`basename $0|cut -d\. -f1`"
TMP="/tmp/${PGM}.$$"
LOG="$HOME/log/${PGM}.log"
FILERS="$HOME/etc/filers_cdot"
FILTER="[?]*"

for FILER in `cat ${FILERS}|grep -v \^#|grep ${FILTER}|awk -F\; '{print $1}'|sort`
do
  echo "${FILER}:" | tee -a ${LOG}
  if [ "${1}" = "DOCMDS" ]; then
#
# The commands
#    ssh ${FILER} options autosupport.support.transport https
#    ssh ${FILER} options autosupport.support.proxy '10.192.8.29:63001'
#    ssh ${FILER} options autosupport.to 'fsod@atos.net,support@e-storage.nl,mdrglob@msssyscol01.bcklan.ao-srv.com'
    ssh ${FILER} options autosupport.doit Check-ASUP-5aug2015-10H45
    sleep 1
  else
    echo "Command(s) will not be done. Wrong parameter. Only logging."
  fi
# The check
  ssh ${FILER} hostname
#  ssh ${FILER} options autosupport.support.transport | tee -a ${LOG}
#  ssh ${FILER} options autosupport.support.url | tee -a ${LOG}
#  ssh ${FILER} options autosupport.support.proxy | tee -a ${LOG}
#  ssh ${FILER} options autosupport.to | tee -a ${LOG}

done

exit 0

