|
Home > Archive > Unix questions > January 2007 > Shutdown Script
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| rgreinerjr@charter.net 2007-01-12, 1:16 pm |
| I am a Windows guy moving into the Unix world. Our support desk has
requested a shutdown script for all our servers in the datacenter. Of
course a simple tool for our Windows Servers was found and utilized,
but it has a been a bit more difficult for the Unix servers (factor in
my limited knowledge). We created scripts that attach to each server
and run shutdown commands. I have one more issue to resolve.
I need to simplify it for our helpdesk. I need a way from a windows
machine to double click an icon, it will connect to the host unix
server, ask for a password, after the password has been entered it will
log into the server and run the script (the script has various options)
and ultimately shutdown all the servers.
Any help would be greatly appreciated.
Thanks
Rich
| |
| Mark Hobley 2007-01-12, 7:20 pm |
| rgreinerjr@charter.net wrote:
>
> I need to simplify it for our helpdesk. I need a way from a windows
> machine to double click an icon, it will connect to the host unix
> server, ask for a password, after the password has been entered it will
> log into the server and run the script (the script has various options)
> and ultimately shutdown all the servers.
That is no problem, you can use UDP sockets to communicate between the two
systems, or you could transfer a file onto the unix system, and have
scripts running which periodically look out for the file and shut down the
system if it is found.
Regards,
Mark.
--
Mark Hobley
393 Quinton Road West
QUINTON
Birmingham
B32 1QE
Telephone: (0121) 247 1596
International: 0044 121 247 1596
Email: markhobley at hotpop dot donottypethisbit com
http://markhobley.yi.org/
| |
| Jens Thoms Toerring 2007-01-12, 7:20 pm |
| rgreinerjr@charter.net wrote:
> I am a Windows guy moving into the Unix world. Our support desk has
> requested a shutdown script for all our servers in the datacenter. Of
> course a simple tool for our Windows Servers was found and utilized,
> but it has a been a bit more difficult for the Unix servers (factor in
> my limited knowledge). We created scripts that attach to each server
> and run shutdown commands. I have one more issue to resolve.
> I need to simplify it for our helpdesk. I need a way from a windows
> machine to double click an icon, it will connect to the host unix
> server, ask for a password, after the password has been entered it will
> log into the server and run the script (the script has various options)
> and ultimately shutdown all the servers.
I gues that's not much of a Unix problem and more a problem of how
to write a script for the Windows side - at least if the server
has a running ssh daemon and on the Windows machine ssh is installed.
Then you can run whatever command on the server from the Windows
machine,e.g.
ssh root@servername 'shutdown -h now'
(of course, that requires that the ssh daemon is configured to allow
root logins). You can execute whatever commands you want into it,
also several at once:
ssh servername "./cleanup && su - -c 'shutdown -h now'"
which would first ask for the normal user name, run the cleanup
script and, if that ended successfuly, then ask, in order to
shutdown the machine, for the root password (and in this case
allowing direct root logins via ssh wouldn't be required).
Then the only problem for you is wrapping that into some Windows
script or program (or whatever you guys use under Windows;-) that
interacts with ssh (like for example using 'expect') to be able to
ask for the password(s) first and then pass it to ssh when required.
Of course, there are also other ways to do it, like writing a
daemon that listens on one of the servers ports etc. and have a
client or connecting to that port on the Windows machines, but
that probably would be shooting birds with a canon when you
easily can use something like ssh for the purpose.
But are you really sure tht you want to allow the helldesk to
shutdown all your machines? Normally you shutdown Unix machines
only when absolutely required (e.g. when a new kernel needs to
be booted) and giving the helpdesk such power looks rather un-
usual to say the least...
Regards, Jens
--
\ Jens Thoms Toerring ___ jt@toerring.de
\__________________________ http://toerring.de
|
|
|
|
|