Need help creating script for Navi Analyzer using 6.26
I just took over a new Clariion CX3-80 and need help retrieving .nar files. I have created a user on the system, turned on data gathering and changed the interval to 600 seconds. I want to be able to grab the archives files every morning. I have the option of using Linux or Windows to grab these files.
We were using this script on the old CX700's that we recently returned.
Use whichever platform you are comfortable with for scheduling the script. We are a Windows shop so the script below is a batch script that I use to gather the archives on a daily basis using Windows Task Scheduler. All the arrays are on FLARE 26 and I scheduled the script using a service account that has a security file created for Navisecsli. The script collects the archives and then renames them with a datestamp so that I have a history of archive files in a directory for each array.
REM Analyzer Archive Retrieve Script
@echo off
echo Dumping analyzer data from SPA on all arrays...
Java Commands (the JAVA commands will not work with release 26 ¿ there will be new naviseccli commands in release 26 that will achieve the same results)
The archiveretrieve.jar command will create an archive (stored on the SP) and retrieve the file
If you run the command before the next 10 data points have been collects, the file retrieved will be the last one created.
The files created with the archiveretrieve command will remain on the array ¿ there is a limit on the number of archives stored, when this limit is reached the oldest archives will be overwritten.
Release 26 will be the last release to support the JAVA commands. You can use the release 24 java commands for use with release 24 and earlier arrays, but not with release 26 arrays.
The analyzer ¿.jar¿ files will not be installed when you install release 26 CLI. If you install over release 24 and already have the ¿.jar¿ files, you will have the option to keep them.
New Commands with Release 26 ¿ will work the same as the JAVA commands now work ¿ you can run these commands against a release 26 and lower array
Archiveretrieve Archivedump Archivemerge
Remember that the script below will only work on arrays where analyzer is enabled and running AND for release 26 and higher that Periodic Archiving is Disabled AND ¿Stop Automatically After¿ is not enabled.
Using a .BAT file to retrieve archives ¿ I call the file ¿getnar.bat¿.
Find a Windows workstation (management workstation) and install the latest Navisphere CLI release 26.
Create a bat file, getnar.bat (see sample script below), in the c:\program files\emc\navisphere cli\ directory.
Then create a new directory called \archive off the "navisphere cli" directory.
Modify the parameters in the commands to match your system:
- you'll need the IP address for SPA and SPB - the username\password of a global admin user on the array that you intend to run the batch file against - change the -file parameter to give the archive a name that matches the array, maybe the last 4 digits of the serial number
Then create a Scheduled Task in Windows to run the batch file every xx interval
- xx is based on the archive interval that you have set on the array \
- if the archive interval is 600 seconds, run the program every 24 hours - if the archive interval is 300 seconds, run the program every 12 hours - if the archive interval is 120 seconds, run the program every 4 hours - if the archive interval is 60 seconds, run the program every 2 hours.
The overwrite really isn't necessary, I just put it in there in case the file rename doesn't work. But with the file rename option to put a date stamp on the file the overwrite parameter has never been needed.
instead of overwrite move old file to name.old for EX in Linux/Unix Environment " mv test test.old" and maybe also " mv test.old test.veryold" then , as Kelleg and Arnah suggested ( big thx 4 Kelleg and Arnah )
AranH1
2163 Posts
189
0
Posted October 13th, 2008 11:00
REM Analyzer Archive Retrieve Script
@echo off
echo Dumping analyzer data from SPA on all arrays...
cd "C:\Program Files\EMC\Navisphere CLI"
naviseccli -h 10.x.x.x analyzer -archiveretrieve -file Cx3-80a_SPA.nar -location c:\SAN\Analyzer\PXDC_Cx3-80a -Overwrite y -Retry 2 -v
naviseccli -h 10.x.x.x analyzer -archiveretrieve -file Cx700a_SPA.nar -location c:\SAN\Analyzer\PXDC_Cx700a -Overwrite y -Retry 2 -v
naviseccli -h 10.x.x.x analyzer -archiveretrieve -file Cx700b_SPA.nar -location c:\SAN\Analyzer\PXDC_Cx700b -Overwrite y -Retry 2 -v
naviseccli -h 10.x.x.x analyzer -archiveretrieve -file Cx3-20a_SPA.nar -location c:\SAN\Analyzer\PXDC_Cx3-20a -Overwrite y -Retry 2 -v
echo Renaming files to inlcude date stamp
FOR /F "TOKENS=1* DELIMS= " %%A IN ('DATE/T') DO SET CDATE=%%B
For /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set date=%%a%%b%%c)
ren c:\SAN\Analyzer\PXDC_Cx3-80a\Cx3-80a_SPA.nar "%date%_Cx3-80a_SPA.nar"
ren c:\SAN\Analyzer\PXDC_Cx700a\Cx700a_SPA.nar "%date%_Cx700a_SPA.nar"
ren c:\SAN\Analyzer\PXDC_Cx700b\Cx700b_SPA.nar "%date%_Cx700b_SPA.nar"
ren c:\SAN\Analyzer\PXDC_Cx3-20a\Cx3-20a_SPA.nar "%date%_Cx3-20a_SPA.nar"
echo Analyzer dump complete
exit