Script to manage multiple Servers using Avamar

It is becoming more difficult to manage more than 100 servers in my case we have close to 7000 servers, to successful backup and manage those servers using Avamar requires some sort of automation this script will help you manage multiple servers. You only need to create a file and reference the path "/home/endusersupport/workstations" and add as many servers as you can.

#!/bin/bash

########## To on-board Avamar Workstations #################################################

#### Version 1 ####

#### Lloyd     ####

date=$(date '+%d%m%Y')

AVM='/usr/local/avamar/bin/mccli'

EU='invite'

SA='activate'

CK='re-register'

LL='client'

#### Run this script only if you have root privilege #####

read -r -p "Are You Sure? [Y/n] " input
 

case $input in

    [yY][eE][sS]|[yY])

echo "Yes"

;;

    [nN][oO]|[nN])

echo "No"

   exit 1

       ;;

    *)

echo "Invalid input..."

exit 1

;;

esac

 

input="/home/endusersupport/workstations"

while IFS= read -r line

do

 

   echo "$line"

  ${AVM}   ${LL} add --name=$line.jhah.com --domain=/DTLT

  ${AVM}   group add-client --client-name=/DTLT/$line.jhah.com --name=/DTLT/Dhahran_06_6PM

  ${AVM}   ${LL} ${EU}  --name=/DTLT/$line.jhah.com

  ${AVM}   ${LL} ${SA}  --domain=/DTLT --name=$line.jhah.com

  ${AVM}    ${LL} ${CK} --domain=/DTLT --name=$line.jhah.com

  ${AVM}   client delete --name=$line.jhah.com --domain=/DTLT

  ${AVM}   group move-client --client-domain=/DTLT --client-name=$line.jhah.com --name=/DTLT/ABQAIQ_02_10AM --old-group-name=/DTLT/ABQAIQ_03_6PM

  ${AVM}   backup show --domain=/DTLT/ --name=$line.jhah.com

  ${aVM}   group show-members  --domain=/DTLT --name=Dhahran_06_6PM

  ${AVM}   group   remove-client --client-domain=/DTLT/Dhahran_07_7PM  --client-name=/DTLT/$line.jhah.com --domain=/DTLT --name=Dhahran_07_7PM


done < "$input"

     echo "Great Job the workstations are now activated"

Comments