UNSOLVED

AndyWOhio

updated

15 years ago

A

AndyWOhio

1 Rookie

•

21 Posts

4

3419

February 22nd, 2012 14:00

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

  • 1438

    1

    Posted February 27th, 2012 04:00

    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 Rookie

    •

    21 Posts

    1438

    0

    Posted February 27th, 2012 11:00

    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

  • AndyWOhio

    1 Rookie

    •

    21 Posts

    1438

    1

    Posted March 2nd, 2012 13:00

    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

  • 1438

    0

    Posted May 2nd, 2016 05:00

    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.