Script SSH to shutdown DX80

FibreCAT SX, FibreCAT NX, FibreCAT TX, ETERNUS DX, ETERNUS LT, ETERNUS CS

Moderator: ETERNUS Moderator Team

Jose_IT
Posts: 6
Joined: Tue Feb 05, 2013 12:11
Product(s): ETERNUS DX80

Script SSH to shutdown DX80

Postby Jose_IT » Tue Feb 05, 2013 14:43

Hi all!!

First of all thanks for this forum, it's been very useful many times in my learning...

however I've not found anything related to the following topic.

I have ETERNUS DX80 storage and my intention is to shutdown the cabin automatically using a script, so when the UPS detect lost of power send this script, but I am not able to generating public/private dsa key pair for an user.

So any hint would be very appreciate!!!


Tanks so much for the futures answers!!!

Jose_IT
Posts: 6
Joined: Tue Feb 05, 2013 12:11
Product(s): ETERNUS DX80

Re: Script SSH to shutdown DX80

Postby Jose_IT » Tue Feb 05, 2013 16:35

Hello again,

I've got to connect using a ssh connection but just I can loggin into the cabine, however once I put any command in the same script, e.g "show date", the message "FATAL ERROR: Server unexpectedly closed network connection"

Any comments???

Thanks!!

User avatar
elsie
Posts: 137
Joined: Wed May 28, 2008 20:46
Product(s): Servers, Networking

Re: Script SSH to shutdown DX80

Postby elsie » Mon Feb 11, 2013 17:39

Are you trying to embed the DX command within the SSh command? e.g.
ssh root@dx.sna.local shutdown -mode off

This has always failed. However, you can script it using, for example 'expect'
spawn telnet "dx.sna.local "
expect "login:"
send "root\r"
expect "Password:"
send "ThePassword\r"
expect {
">" {
send "shutdown -mode off\r"
expect ">"
sleep 2
send "exit\r"
expect eof
}
"Login incorrect" {
send_error "bad password\n"
}
}
exit

Jose_IT
Posts: 6
Joined: Tue Feb 05, 2013 12:11
Product(s): ETERNUS DX80

Re: Script SSH to shutdown DX80

Postby Jose_IT » Tue Feb 12, 2013 17:01

Hello!!Thank you so much for yor reply!!!

Let me explain what I've done.

From a client(Windows XP) which is in the same network that the Storage I have the "plink" application in order to connect to the DX80 using a SSH, so first of all I created the pair of ssh keys(public and private) and after that I assign this public key to a DX80's user.

Ok then from this client I can looging using ssh connection:

"plink -i private_key -l user 192.168.1.XX"

However if I want to put more commands , for example "plink -i private_key -l user 192.168.1.XX shutdown -mode off" I get the following error:"FATAL ERROR:Server unexpectedly closed network"

Anyway I like your propouse about "expect" command but I am not able to understand at all your script, do you mind give me more information??

Do you know how it works the section "Shutdown by External Power Management Unit"???Because in my enviorment a using UPS...maybe is easier!!but I don't know to connect the DX80 to UPS??


Thank you so much for your support!!!I really appreciate it!!!

User avatar
elsie
Posts: 137
Joined: Wed May 28, 2008 20:46
Product(s): Servers, Networking

Re: Script SSH to shutdown DX80

Postby elsie » Thu Feb 14, 2013 14:53

To run the script you would need to install TCL Expect on your windows - see http://www.nist.gov/el/msid/expect.cfm.

Instead of calling plink, you call the TCl Expect programming point it at the script (you would need to edit to reflect IP address and password). This effectivelt calls plink in a controller fashion and issues the shutdown command.

Jose_IT
Posts: 6
Joined: Tue Feb 05, 2013 12:11
Product(s): ETERNUS DX80

Re: Script SSH to shutdown DX80

Postby Jose_IT » Thu Feb 21, 2013 17:37

Hello Elsie,

Thanks a lot for your answers!!but I think that I am very useless person...sorry...let me explain you...

I have the expect program but I am not able to run it, so the thing what I want to get is that using "expect" command launch your script????but there is something that I cann't understand in your last post, I have to call expect using plink command?How can send commands to my DX80 using expect command????I've read the man but really that I don't understand how to run it...sorry to be so tiring!!!

Again, really appreciate it your help!!!!

User avatar
elsie
Posts: 137
Joined: Wed May 28, 2008 20:46
Product(s): Servers, Networking

Re: Script SSH to shutdown DX80

Postby elsie » Tue Feb 26, 2013 14:51

I would save the script previously supplied in a file called shutdown.tcl
On my system (32-bit Windows XP), Expect is installed in C:\Program Files\Expect-5.21\bin
So to call the program from a Command Prompt window (aka DOS Window) on my PC, I type:

Code: Select all

C:\Program Files\Expect-5.21\bin\TclSh80.exe  shutdown.tcl


You need to have PLINK.exe on you PATH, or the local directory. PLINK is a command line interface to PuTTY.

Jose_IT
Posts: 6
Joined: Tue Feb 05, 2013 12:11
Product(s): ETERNUS DX80

Re: Script SSH to shutdown DX80

Postby Jose_IT » Thu Feb 28, 2013 17:13

Thanks again!!!

I'm going to try and I'll let you know with the result, so the idea is the following:

Using plink call your script right??

plink -i private_key -l user 192.168.1.XX C:\Program Files\Expect-5.21\bin\TclSh80.exe shutdown.tcl

I hope it works!!!

Tks!!!

Jose_IT
Posts: 6
Joined: Tue Feb 05, 2013 12:11
Product(s): ETERNUS DX80

Re: Script SSH to shutdown DX80

Postby Jose_IT » Fri Jun 28, 2013 13:08

Hello again!!After a hard work tried to logging using a script non-interactive to shutdown the cabin( o whatever the command that you want to send without any interaction) the support of Fujitsu gave me the following program :"Eternus Batch Processing Manager V1.03." designed for this propose!!If anyone wants it just let me know and I'll provide you.

lucienne3
Posts: 2
Joined: Fri May 04, 2018 10:49
Product(s): DX100 S3

Re: Script SSH to shutdown DX80

Postby lucienne3 » Wed Mar 27, 2024 17:38

Hi , i need a script to automate the shutdown of DX60S5 , in case of power loss , using APC network shutdown . Someone could help me ?

User avatar
Ask Fujitsu
Moderator
Posts: 741
Joined: Fri Aug 02, 2019 10:02
Product(s): n/a
Contact:

Re: Script SSH to shutdown DX80

Postby Ask Fujitsu » Mon Apr 08, 2024 13:38

Hello,
Thank you for contacting us.

For shutting down storage you can use CLI command
>>shutdown -mode off
See page 620 of CLI manual by the link below.

Use ssh protocol and invoke Non-interactive CLI command execution. (page 24 of CLI manual)
For doing power-on please familiar yourself with Wake-On-Lan feature. You can enable it on storage via CLI (page 697) or via GUI:

[System] -> [Network] -> [Setup Network] for MNT interface -> [Wake-On-Lan Enabled]
I'd also recommend to check power management options:
[System] -> [System Settings] -> [Setup Power Management]
Auto Power - Automatically start storage as soon as power cable connected.
Power resume - Automatically start storage after outage, as soon as power recover. Otherway storage waits for Wake-On-Lan or manual start from Front Panel.

If you need to shutdown Brocade switches as well you can use CLI command
>>sysshutdown

Here is the link to the CLI manual:
https://support.ts.fujitsu.com/IndexDow ... D23E862841

Kind regards,
Forum Support Team


Return to “Storage solutions”

Who is online

Users browsing this forum: No registered users and 1 guest

cron