AndyWOhio
1 Copper

symcli script examples

I have seen a few old attempts at scripting threads, but haven't seen any take off.


Anyone have any symcli scripts that they'd like to share?  I'll start off with this one.  "emc-maskrep".  This script uses symacces commands to document the masking views for a VMax.  Its written in perl, and uses the XML::Simple and Data::Dumper perl modules to parse the XML output of the symaccess commands.

http://www.the-welters.com/professional/scripts/emc-maskrep.txt

4 Replies
Lars4
2 Iron

Re: symcli script examples

Good initiative !!

I'm not a script guru but I did manage to convert it to Windows ...my first look at perl .......

1) Download Perl from Windows @ http://www.activestate.com/activeperl/downloads

2) add symcli/bin to you PATH

http://justpaste.it/emc-maskrep_wintxt

AndyWOhio
1 Copper

Re: symcli script examples

Lars,
Thanks for the feedback.  I'll take a look at the changes to support windows that you made, that will help me make my scripts more multi-platform.

The XML stuff is kind of obscure and complicated.  It was probably a harder script to understand than most perl.  Were my comments helpful enough?

Andy

0 Kudos
AndyWOhio
1 Copper

Re: symcli script examples

I mentioned this script in a different thread, but I'll post it here to keep this consolidated.

Any other scripts that people want to brag about? 

emc-listlogins takes the output of "symaccess list logins" and makes it easier to read, and flags possible errors.  it lists the intitiator group that is assoicated with a login, making note of logins that do not have an initiator group.  it also makes note of initiator group entries that do not have an active login on the VMax.  Like my other scripts, this one uses XML output, so it requires the perl modules to use it.

http://www.the-welters.com/professional/scripts/emc-listlogins.txt

sistemisan
1 Copper

Re: symcli script examples

Hi, these few lines can help someone that need to check the SRDF replica state.

bye

#!/bin/ksh

for sid in XXX

do

    /usr/symcli/bin/symrdf -sid $sid list -rdfg all | grep -v '-' | grep -v "Consistent" | grep -v "Synchronized" |egrep "RW|WD" >/tmp/ciao.txt

    # [ -s /tmp/ciao.txt ]&& cat /tmp/ciao.txt |\

    if [ -s /tmp/ciao.txt ]; then cat /tmp/ciao.txt |\

       mailx -s "symdev su VMAX XXX in different state that "Sync" or "Consistent"" mail@mail.com

     else

        exit 0

     fi

done

byebye

Monardo G.A.

0 Kudos