Start a Conversation

Unsolved

This post is more than 5 years old

8514

November 8th, 2011 14:00

VPLEXCLI execution via SSH

Currently I find that the only way I can execute VPLEXCLI commands is to first ssh on to the array, and second type "VPLEXCLI" which again prompts for user/password, and then I am in a position to execute VPLEXCLI commands.

Is there a way where I can avoid this and get the command o/p directly from a host by ssh. i.e .

host# ssh -l admin@vplexarray1.example.com -pw password VPLEXCLIcommands

If this is not plaucible, then are there any API's that can directly get the storage information of the VPLEX?

Thanks very much in advance.

9 Legend

 • 

20.4K Posts

November 8th, 2011 15:00

There is plink for windows that can take pw as an argument..same developer as putty.

Sent from my Verizon Wireless 4GLTE Phone

November 8th, 2011 15:00

Here is a trick I have done before, I haven't tried this on the vPlex platform, but give it a shot to see if you can embed the authentication request in the command for the CLI commands.

echo -e username"\n"password"\n | /bin/command options

2 Posts

November 8th, 2011 16:00

The issue I see here is that :
VPLEXCLI is nothing but 'exec telnet localhost 49500'

So if you are ssh'ing from a host on to the VPLEX, you cannot get the CLI o/p in a non-interactive manner - which is a bummer, unless some EMC gurus seeing this can suggest some clever solution.

Host>   ./halssh service@10.182.67.47 -pw 234@#@# 'exec telnet localhost 49500'

Using keyboard-interactive authentication.

Trying 127.0.0.1...

Connected to localhost.

Escape character is '^]'.

So even if you ssh in to the array with the "pw" you are still stuck in the telnet local host port 49500.

9 Legend

 • 

20.4K Posts

November 8th, 2011 17:00

For thing like that ive used logmett macros

http://logmett.com/index.php?/products/logmett.html

Sent from my Verizon Wireless 4GLTE Phone

286 Posts

November 8th, 2011 17:00

You could use the API and skip SSH altogether. Refer to page 607 in the product guide:

http://powerlink.emc.com/km/live1//en_US/Offering_Technical/Technical_Documentation/300-012-311.pdf

Requires a good amount of setup and knowledge of REST API programming but once you get it working it will make things much easier.

 

"VPLEX Element Manager API uses the Representational State Transfer (REST) software architecture for distributed systems such as the World Wide Web. It allows software developers and other users to use the API to create scripts to run VPLEX CLI commands. "

November 15th, 2011 18:00

https://community.emc.com/thread/128550

See the above script for an example of how to use the REST API via Powershell.

57 Posts

November 1st, 2012 18:00

Login to the VPlex management server as service and create the following script called health (using vi) in the service home directory

#!/usr/bin/expect -f

# connect to vplexcli

spawn vplexcli

# Look for login prompt

expect -re "Name:"

# Send login

send "service\r"

# Look for password prompt

expect -re "Password:"

# Send password

send "Mi@Dim7T\r"

expect -re "VPlexcli:/> "

send "health-check\r"

expect -re "VPlexcli:/> "

expect eof

Set the permissions to executable (chmod 755 health).

From your windows desktop/laptop execute the following (you must have plink installed on your system)

plink -ssh cluster-ip-address -l service -pw Mi@Dim7T ./health > health-report

The output will be written to a local file on your desktop/laptop called health-report

If your os supports expect (there is a freely available pakage for windows) your expect scripts can be run directly from your desktop/laptop.

This is a very simple example! expect is a rich scripting langauge that will allow you to execute very complex vplexcli commands!!

No Events found!

Top