Unsolved

This post is more than 5 years old

1 Rookie

 • 

5 Posts

2328

November 13th, 2017 05:00

Strange output from Unity via uemcli

Hello,

If I give the following command in a dos box:

uemcli -d ***.***.***.*** -u Local/****** -p ******** -noHeader /sys/general show -filter "Health state"

I receive the following answer:

1:    Health state = OK (5)

If I give the same command in a perl script then something went wrong, and I get the following answer:

■1 :         H e a l t h   s t a t e   =   O K   ( 5 )

There are spaces between every character.

If I run the perl script and print the output in a file I see on every space the word NUL

ÿþ1NUL:NUL NUL NUL NUL NUL NULHNULeNULaNULlNULtNULhNUL NULsNULtNULaNULtNULeNUL NUL=NUL NULONULKNUL  NUL(NUL5NUL) NUL NUL

I also use this script to check the health status on several VNX's without any problems.

Is there somebody who can help me with this?

Regards,

Efclem.

4 Operator

 • 

8.6K Posts

November 13th, 2017 16:00

please open a service request and ask customer service if this warrants to file an engineering bug

1 Rookie

 • 

5 Posts

November 14th, 2017 03:00

Thanks, I opened a service request..

4 Operator

 • 

8.6K Posts

November 14th, 2017 07:00

you're welcome

September 18th, 2018 04:00

Hello, I have the same issue, did your service request resolved the problem? I think it is a encoding/UTF8? problem, so the output needs to be handled in Perl/Powershell.

September 18th, 2018 06:00

Found the solution by myself, as it is documented in EMC Unisphere CLI Version 1.5.1 User Guide

Earlier versions of the CLI (prior to 1.5.1.1) used ASCII encoding or a superset of ASCII. In order to be able to display localized names, VNXe Unisphere CLI (Windows only) enforces the output to be in wide char format (UTF-16) with BOM. There have been reports of problems when using Perl on Windows with the VNXe Unisphere CLI. Since returned bytes are using an encoding that is not a superset of ASCII, this results in the characters being unreadable. The script writer may need to decode those bytes from UTF-16 into Unicode characters.

The following is an example of one way to decode the bytes within a Perl script. Note that the means of decoding in other scripting languages will vary:

if (@ans && $ans[0] =~ m/\x00/) {

my $s = decode('utf-16', join(encode('ucs-2', "\n"), @ans));

@ans = split(/\n/, $s);

}

No Events found!

Top