Start a Conversation

Unsolved

This post is more than 5 years old

1269

August 14th, 2017 09:00

Unity 4.2.0 snapshot replication status: problem with filter

Hello,

I can see the Replicated status of a snapshot on a consistency group by outputting all the information but I cannot get it to work using the -filter option. Please see the examples below.


Would someone please indicate the correct column name to pass to the filter option to recover the value of the Replicated column because I need to determine if it 'yes' rather than 'pending'.


I can get by without using a filter option but it is not as tidy a solution.


Thanks,

Rob Gordon

> uemcli -noHeader -d 10.193.5.66 /prot/snap -name MTcg3_1.uniidrtst_TST1 show -detail

1:    ID                       = 85899345956

      Name                     = MTcg3_1.uniidrtst_TST1

      State                    = Ready

      Attached                 =

      Source                   = res_1

      Source Type              = LUN group

      Members                  = sv_1, sv_2

      Attach details           =

      Source Snapshot          =

      Description              =

      Creation time            = 2017-08-14 14:21:19

      Expiration time          = 2017-08-21 14:21:19

      Last writable time       = Never

      Last refresh time        = Never

      Created by               = admin

      Modified                 = no

      Allow auto-delete        = no

      Size                     =

      Access                   =

      IO limit                 =

      Effective maximum IOPS   =

      Effective maximum KBPS   =

      Read/write hosts         =

      Read-only hosts          =

      Replicated               = yes

      Remote expiration time   = 2017-08-21 14:21:19

      Remote Allow auto-delete = no

or the following command:

> uemcli -noHeader -d 10.193.5.66 /prot/snap -name MTcg3_1.uniidrtst_TST1 show -o csv -detail

"ID","Name","State","Attached","Source","Source Type","Members","Attach details","Source Snapshot","Description","Creation time","Expiration time","Last writable time","Last refresh time","Created by","Modified","Allow auto-delete","Size","Access","IO limit","Effective maximum IOPS","Effective maximum KBPS","Read/write hosts","Read-only hosts","Replicated ","Remote expiration time","Remote Allow auto-delete"

"85899345956","MTcg3_1.uniidrtst_TST1","Ready","","res_1","LUN group","sv_1, sv_2","","","","2017-08-14 14:21:19","2017-08-21 14:21:19","Never","Never","admin","no","no","","","","","","","","yes","2017-08-21 14:21:19","no"

The filter option works with every column title that I have ever tried apart from Replicated.

> uemcli -noHeader -d 10.193.5.66 /prot/snap -name MTcg3_1.uniidrtst_TST1 show -o csv -filter "Name,Creation time"

"Name","Creation time"

"MTcg3_1.uniidrtst_TST1","2017-08-14 14:21:19"

I have tried with and without the trailing space as reported in the -o csv -detail output above but neither attempt works.

> uemcli -noHeader -d 10.193.5.66/prot/snap -name MTcg3_1.uniidrtst_TST1 show -o csv -filter "Name,Replicated "

Operation failed. Error code: 0x1000017

Command line parsing failed near "Replicated" token.

There is a syntax error in the command. Please recheck the command syntax. (Error Code:0x1000017)

> uemcli -noHeader -d 10.193.5.66/prot/snap -name MTcg3_1.uniidrtst_TST1 show -o csv -filter "Name,Replicated"

Operation failed. Error code: 0x1000017

Command line parsing failed near "Replicated" token.

There is a syntax error in the command. Please recheck the command syntax. (Error Code:0x1000017)

169 Posts

August 16th, 2017 14:00

you have a syntax error with the fields. Field names should be comma separated, case sensitive, double quote is must if it has spaces.

"Name,Replicated" should be "Name","Replicated"


Edit : I see the issue. You are right. The Replicated filter is not working. I will raise a ticket internally for this.


I think we could use some workarounds for now like grep:


04:35:35 service@spa:~> uemcli -noHeader /prot/snap show -detail | egrep "Name|Replicated"

      Name                     = UTC_2017-08-16_05:34:02

      Replicated               = no


Or if csv is required, awk will be handy:


04:38:41 service@spa:~> uemcli -noHeader /prot/snap show -detail  | egrep -n "Name|Replicated"

     2        Name                     = UTC_2017-08-16_05:34:02

    25        Replicated               = no

04:39:26 service@spa:~> uemcli -noHeader /prot/snap show -detail -output csv | awk -F, '{OFS=",";print $2,$25}'

"Name","Replicated "

"UTC_2017-08-16_05:34:02","no"


August 17th, 2017 02:00

Thanks for raising a ticket for this.

I'd resorted to doing the equivalent of what you suggest, in the Windows world unfortunately.

169 Posts

August 17th, 2017 16:00

Windows world is not too bad. I am sure something may be possible even with a batch scripts (for loop) but powershell is very easy. Below is a simple example from powershell on a windows 7 :

PS C:\> uemcli -no -d 10.11.12.13 -sslpolicy accept /prot/snap show -detail -output csv | %{$x=$_-split '","'; write-host $x[1]","$x[24];}

Name , Replicated

UTC_2017-07-19_12:00:20 , no

User1_snap , no

81604378625_CKM00181_0000.ckpt000_8538523750630080.1_123 , yes


Note: the delimiter of just comma is not enough as some entries can have a comma already, so my earlier bash example will be inaccurate. I used “,” as a split delimiter here to have correct info.

No Events found!

Top