Nice Simple Batch File (TrueCopy Turnover Report)

Hello,

I have used this simple batch file which can run as many times a day as you want.  But it has come in handy just to provide a nice turnover report without having to login into SNM2 GUI or CLI.  I am sure there could be more controls placed into this script for error control but, I figured it was a nice start for anyone needing to do the same kind of stuff.  Enjoy…

 

REM - Replication Status


@echo off
@rem Set the HDS Params to automate username and password login to the array

set STONAVM_HOME=C:\Program Files (x86)\Storage Navigator Modular 2 CLI
set LANG=en

@rem Disable prompting ***** BE EXTREMELY CAREFUL *****
@rem  ##### Assume "Y" to *all* prompts
set STONAVM_RSP_PASS=on

@rem Setup name/pw for account auth
@rem ##### Setup root as our login account for account authentication
@rem       file pw.storage.txt has a copy of the password for user root.
set STONAVM_ACT=on
auaccountenv -set -uid root -passwdfile pw.storage.txt

@rem alt syntax: auaccountenv ñset ñuid root
@rem this will prompt you to enter the pw interactively.

@rem for AMS1000 or 9500 or 9200
@rem no prompts, no local pw, it just ìdoesî the command
set CMDF_NOASK=on

@rem replace the password file that gets deleted
copy temp-pw.storage.txt pw.storage.txt

@echo off
@echo off

@rem Format date stamp for log file naming

@rem set all the variables

	for /f "tokens=1-4 delims=/- " %%a in ('date /t') do set XDate=%%b-%%c-%%d

	set blat="c:\blat\blat\full\blat.exe"
	set email="sendit.com"

:display

	set log="C:\Program Files (x86)\Storage Navigator Modular 2 CLI\log\AMSrep-%XDATE%.log"

		@echo. >> %log%
		@echo Daily Summary Report for True Copy Path and Pair Information >> %log%
		@echo. >> %log%
		@echo. >> %log%
		@echo ---------------------------------------------------------------- >> %log%
		@echo. >> %log%
		@echo This Report Run on %XDATE% at %time% >> %log%
		@echo. >> %log%
		@echo ---------------------------------------------------------------- >> %log%
		@echo. >> %log%

		@echo. >> %log%

		@echo Source AMS Array Path Information >> %log%

		aurmtpath -unit AMS001 -refer >> %log% 

		@echo ---------------------------------------------------------------- >> %log%
		@echo. >> %log%

		@echo Destination AMS Array Path Information >> %log%

		aurmtpath -unit AMS002 -refer >> %log%

		@echo ---------------------------------------------------------------- >> %log%
		@echo. >> %log%

		@echo Current TrueCopy Pair Status >> %log%
		@echo. >> %log%
		@echo ---------------------------------------------------------------- >> %log%
		@echo. >> %log%
		aureplicationremote -unit AMS001 -refer >> %log%

		@rem aureplicationremote -unit AMS002 -refer >> %log%

		@echo. >> %log%
		@echo. >> %log%

		@echo Log file is:  %log%
		@echo Log file is:  %log% >> %log%

blat %log% -s "AIPO / AIMO Replication Status"  -t %email%

:end
Output:  Run the script in your environment... And Enjoy

Leave a Reply