This post is more than 5 years old

2 Intern

 • 

146 Posts

1150

May 2nd, 2007 20:00

Scripting Help - Blat Script to Notify When Adaptive Copy Tracks < 100MB

I'm trying to create a script to notfiy me when Adaptive Copy is less than 100MB's so I can dial in and swtich a device group into sync mode. Anyone out there have any ideas? A peer recommended using FIND (this is a windows ECC host running the script) however, I don't think that will work.

9 Legend

 • 

20.4K Posts

May 8th, 2007 02:00

i am not sure what field Vince is interested in, depending from which side (R1 or R2) he is running symrdf command from will change the "{print $3}" as well ...but i am sure he can figure that out :)

9 Legend

 • 

20.4K Posts

May 3rd, 2007 14:00

vince

is this your system where yon can install tools ? i am running cygwin bash shell on my ECC server. it would be very easy with bash shell to issue symcli command and then filter particular field, check its value and email using windows recource kit utility called postie.

4 Operator

 • 

14.3K Posts

May 4th, 2007 00:00

I agree with dynamox. With bash or even Windows Services for UNIX you could easily script with symcli to get data and check for watermark you wish to check. The issue might be scheduling that as Windows are rather poor in that segment (I found several times where Windows native scheduling software didn't work as it should). Mailing this away with blat is easy - I used several times to setup blat to send notification for NetWorker and it works fine. Above mentioned tools are all freeware (which reminds to ask if anyone knows any good and reliable free scheduling software for Windows?).

9 Legend

 • 

20.4K Posts

May 5th, 2007 08:00

if you have cygwin installed, you could install crond as a service and use crontab as your scheduler. If you want to get a more sophisticated scheduler that handles multiple dependences then you might want to look at Control-M or Tivoli Maestro..but we are talking serious $$$ there :)

9 Legend

 • 

20.4K Posts

May 7th, 2007 13:00

we just brought up scheduling as another issue ..but with unix based tools you will be able to do exactly what you want.

4 Operator

 • 

14.3K Posts

May 7th, 2007 13:00

Thnx! I was not aware crond was available.

2 Intern

 • 

146 Posts

May 7th, 2007 13:00

Sorry guys, my problem is not with Scheduling. I'd be running this task manually. Scenario is this:

New host coming online that needs to be replicated. I don't want the first replication/sync to take all the bandwidth to DR, so first thing I'll do is put the group in Adaptive Copy mode so as to not affect the R1 host, as well as set QoS on the device group. When I resume replication, I want to be notified that Adaptive Copy tracks are less than 100MB so I can know when we can flip the device group back into Sync mode. Instead of me vpn'ing in every hour to check how far along it is, I'd like an email when invalid tracks are less than 100MB so I can set mode sync.

9 Legend

 • 

20.4K Posts

May 7th, 2007 13:00

i'll write a sample bash script so you will see what we are talking about. I am running SRDF semi-sync ..but the idea is the same.

9 Legend

 • 

20.4K Posts

May 7th, 2007 18:00

so here is output from symrdf -g RDGROUP query command.

Device Group (DG) Name             : RDFGROUP
DG's Type                          : RDF1
DG's Symmetrix ID                  : 000187700222
 
 
       Source (R1) View                 Target (R2) View     MODES
--------------------------------    ------------------------ ----- ------------
             ST                  LI      ST
Standard      A                   N       A
Logical       T  R1 Inv   R2 Inv  K       T  R1 Inv   R2 Inv       RDF Pair
Device  Dev   E  Tracks   Tracks  S Dev   E  Tracks   Tracks MDA   STATE
-------------------------------- -- ------------------------ ----- ------------
 
DEV001  02F0 RW       0        0 RW 010D WD       0        0 E..   Synchronized
DEV002  02F1 RW       0        0 RW 010E WD       0        0 E..   Synchronized
DEV003  02F2 RW       0        0 RW 010F WD       0        0 E..   Synchronized
DEV004  02F3 RW       0        0 RW 0110 WD       0        0 E..   Synchronized
DEV005  02F4 RW       0        0 RW 0111 WD       0        0 E..   Synchronized
DEV006  02F5 RW       0        0 RW 0112 WD       0        0 E..   Synchronized
DEV035  0312 RW       0        0 RW 012F WD       0        0 E..   Synchronized
DEV036  0313 RW       0        0 RW 0130 WD       0        0 E..   Synchronized
DEV037  0314 RW       0        0 RW 0131 WD       0        0 E..   Synchronized
DEV038  0315 RW       0        0 RW 0132 WD       0        0 E..   Synchronized
DEV039  05C5 RW       0        0 RW 01CC WD       0        0 E..   Synchronized
DEV040  05C6 RW       0        0 RW 01CD WD       0        0 E..   Synchronized
 
Total          -------- --------           -------- --------
  Track(s)            0        0                  0        0
  MB(s)             0.0      0.0                0.0      0.0
 
Legend for MODES:
 
 M(ode of Operation): A = Async, S = Sync, E = Semi-sync, C = Adaptive Copy
 D(omino)           : X = Enabled, . = Disabled
 A(daptive Copy)    : D = Disk Mode, W = WP Mode, . = ACp off


so i am going to run this script that will loop and query the "R1 Invalid tracks" value, when that value is less than or equal 100, i will send an email and exit the loop.

while true
 do 
   VALUE=`symrdf -g RDFGROUP query|grep "Track(s)"|awk '{print $3}'`
   if [ $VALUE -le 100 ]
   then
    blat.exe - -f vince@blat.com -to vince@blat.com -subject "Vince, vpn in and get back to work !!!"
    exit
   fi
done

9 Legend

 • 

20.4K Posts

May 7th, 2007 18:00

piece of cake ...check out http://www.cygwin.com/ ... the only components you need to install is bash shell. Install it on a test system, virtual machines ..or on your own workstation. Let us know, i can show you how to schedule bash script to run from windows scheduler.

2 Intern

 • 

146 Posts

May 7th, 2007 18:00

Wow - if this works that would be awesome. I'm a pure Windows guy - is this Bash thing complicated?

9 Legend

 • 

20.4K Posts

May 7th, 2007 19:00

it's good if you are waiting for some kind of state ...you can't use it to catch when particular field is at particular value.

410 Posts

May 7th, 2007 19:00

There is another way to do this....
To save on installing CygWin, you can use "verify" instead of query.

(from the docs)
Verifies whether one RDF device pair or all RDF device pairs in a
device group are in the Synchronized state. Optionally, it can
verify whether the RDF device pair or all device pairs in a device
group are in the Updated state, or in any valid RDF pair state.

The RDF verify action returns the following unique return codes
if the verify criteria was not met:

Code # Code Symbol and Description
4 CLI_C_NOT_ALL_SYNCHRONIZED
5 CLI_C_NONE_SYNCHRONIZED
6 CLI_C_NOT_ALL_UPDATED
7 CLI_C_NONE_UPDATED
14 CLI_C_NOT_ALL_VALID
15 CLI_C_NONE_VALID
31 CLI_C_NOT_ALL_SUSPENDED
32 CLI_C_NONE_SUSPENDED
33 CLI_C_NOT_ALL_FAILED_OVER
34 CLI_C_NONE_FAILED_OVER
35 CLI_C_NOT_ALL_UPDATEINPROG
36 CLI_C_NONE_UPDATEINPROG
37 CLI_C_NOT_ALL_PARTITIONED
38 CLI_C_NONE_PARTITIONED
39 CLI_C_NOT_ALL_ENABLED
40 CLI_C_NONE_ENABLED
41 CLI_C_NOT_ALL_SYNCHRONIZED_AND_ENABLED
42 CLI_C_NONE_SYNCHRONIZED_AND_ENABLED
43 CLI_C_NOT_ALL_SUSP_AND_ENABLED
44 CLI_C_NONE_SUSP_AND_ENABLED
45 CLI_C_NOT_ALL_SUSP_AND_OFFLINE
46 CLI_C_NONE_SUSP_AND_OFFLINE
70 CLI_C_NOT_ALL_CONSISTENT
71 CLI_C_NONE_CONSISTENT

complete list can be taken from reference docs.

here is sample output from my windows machine (its more simple to check and process return values on *nix box).

c:\>symrdf -sid 123 -rdfg 3 -g myGroup verify
None of the device(s) in the list are in 'Synchronized' state.
c:\>echo %ERRORLEVEL%
5
c:\>

2 Intern

 • 

146 Posts

May 7th, 2007 19:00

Ac active volume that is in Adaptive Copy will never become syncronized, thats why I needed to grep the field when invalid tracks are less than 100MB so that I can safely switch from adaptive copy to async mode.

410 Posts

May 7th, 2007 19:00

will a delay help between issuing symrdf?
otherwise it will just loop on that command quiet aggressively...
No Events found!

Top