
#!/bin/bash
# File	: cdot_set_asup-config.sh
# By	: Maarten.deBoer@atos.net, 141222
# Subject	: Script to set ASUP config as work a round for Bug: 993376
# https://kb.netapp.com/support/s/article/ka11A0000000pHoQAI/autosupport-can-truncate-on-collection-or-delivery
#set -x
PGM="`basename $0|cut -d\. -f1`"
VER="0.1"
TMP="/tmp/${PGM}.$$"
LOG="${HOME}/log/${PGM}.log"
SSH="/usr/bin/ssh -n"
CLUSTERS="${HOME}/etc/clusters"

for CLUSTER in `cat ${CLUSTERS}|grep -v ^#`
do
  echo "${CLUSTER} ..."
  ${SSH} ${CLUSTER} 'set -privilege diagnostic; system node autosupport modify -node * -max-http-size 50MB'
  ${SSH} ${CLUSTER} 'set -privilege diagnostic; system node autosupport modify -node * -max-smtp-size 20MB'
  ${SSH} ${CLUSTER} 'set -privilege diagnostic; system node autosupport budget modify -node * -subsystem performance_asup -size-limit 350MB -time-limit 10m'
  ${SSH} ${CLUSTER} 'set -privilege diagnostic; system node autosupport budget modify -node * -subsystem performance -size-limit 150MB -time-limit 10m'
  ${SSH} ${CLUSTER} 'set -privilege diagnostic; system node autosupport budget modify -node * -subsystem mhost -size-limit 17MB -time-limit 4m'
  ${SSH} ${CLUSTER} 'set -privilege diagnostic; system node autosupport budget modify -node * -subsystem storage -size-limit 26MB -time-limit 6m'
  ${SSH} ${CLUSTER} 'set -privilege diagnostic; system node autosupport budget modify -node * -subsystem asup_ems -size-limit 4MB -time-limit 2m'
  ${SSH} ${CLUSTER} 'set -privilege diagnostic; system node autosupport budget modify -node * -subsystem kernel -size-limit 6MB -time-limit 2m'
  ${SSH} ${CLUSTER} 'set -privilege diagnostic; system node autosupport budget modify -node * -subsystem wafl -size-limit 30MB -time-limit 10m'

done  # for CLUSTER


echo "`date` ${PGM} v${VER} finished."|tee -a ${LOG}
exit 0

