HPE Storage Users Group

A Storage Administrator Community




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Possibility to force shutdownsys cli-command?
PostPosted: Mon Oct 07, 2013 7:24 am 

Joined: Sat Aug 10, 2013 3:05 am
Posts: 5
Location: Germany
Helly everyone,

i need to create a shutdown-script which should interact with a 3par 7200. I would like to use the "shutdownsys halt" command via ssh, but i need to type "yes" then manually. Is it possible to force this command without needing to type "yes" manually later? I didn't find anything about this in the cli reference and the switch "-f" doesn't work.

Kind regards and thanks in advance!


Top
 Profile  
Reply with quote  
 Post subject: Re: Possibility to force shutdownsys cli-command?
PostPosted: Fri Oct 18, 2013 8:44 pm 

Joined: Wed Oct 16, 2013 9:03 pm
Posts: 44
Location: Chicago
If you're on Linux or a UNIX-based platform, "expect" is a tool used to interact with text-based sessions through scripting. Most platforms have it as part of the default install, or added as a package. Supposedly, it's also available for Windows, but I can't vouch for how it operates there.

See:
http://en.wikipedia.org/wiki/Expect

Here's an example (not tested in the slightest, use at your own risk):
Code:
#!/usr/bin/expect

set timeout 30

# This is to directly connect to an array, though should be
# easily altered to use a local CLI. Assumes you're using
# SSH-key-based authentication, to avoid setting up a
# password in the script.

spawn ssh "user@your-3par-array"

expect "%"
send "shutdownsys halt\r"

# The prompt reads:
# Do you REALLY want to HALT this InServ? yes or no: yes

expect "yes or no:"
send "yes\r"


Top
 Profile  
Reply with quote  
 Post subject: Re: Possibility to force shutdownsys cli-command?
PostPosted: Thu Nov 21, 2013 5:36 am 

Joined: Sat Aug 10, 2013 3:05 am
Posts: 5
Location: Germany
Great, i will check that now. Thanks a lot!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 


Who is online

Users browsing this forum: No registered users and 61 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group | DVGFX2 by: Matt