tevert

Remote Shutdown (UPS)

Recommended Posts

Hi,

 

I have a number of machines all with UPS's. I was thinking that one of my Windows machines could run an app or script that shuts down my UNRaid machine when there's a power outage.

 

What ways are available to me to doing that?

 

I presume I could telnet in, log in, run "shutdown " with some parameters maybe? Is that clean enough to be useful? (I'm not a Linux guru, although I might be a guru on other platform(s)... ;-) ) This method sounds error prone--if timing isn't just right.

 

Is there a better, more foolproof way to remotely, and cleanly shutdown an UNRaid machine?

 

Thanks,

 

Tony

 

 

Share this post


Link to post
Share on other sites

There used to be a shell script of commands to stop the unRAID server.  It does not seem to be there in the most current beta.

 

In any case, basically it did this, you can do it by hand:

cd

samba stop

sync

fuser -km /mnt/user

for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

do

fuser -km /mnt/disk${i}

umount /dev/md${i}

done

/root/mdcmd stop

poweroff

Share this post


Link to post
Share on other sites

Cool! now...

How do I trigger this in a foolproof way from a Windows box?

 

(my goal being when my windows box is notified of a power outage from its UPS, it will shut down the UNRAID machine, since I know of no other way to shutdown my UNRAID machine automatically in a power outage--and we have relatively frequent, long power outages).

 

Thanks!

Share this post


Link to post
Share on other sites

don't most power monitoring softwares have the option to, as part of the alert, run a specific program?

Share this post


Link to post
Share on other sites

Absolutely, we can trigger a program, a script, a .net app, a batch file. The question would be what program or script or whatever should we use to get the message from a Windows box over to UNRAID to shut down. What combination of programs would do it?

 

I assume that trying to start from scratch building a shell to a telnet and feeding it text with delays is un-ideal and error prone.

 

Is there some app, or telnet client, or command-line program that would simplify the process of executing the above commands on the UNRAID machine--calling them from an external Windows box.

 

Thanks,

 

Tony

Share this post


Link to post
Share on other sites

The thread link I provided above mentions the use of the telnet scripting tool.

Other then that the only option is to use wget or some other program to connect/press buttons on the web interface.

First a stop, then a power down.

Share this post


Link to post
Share on other sites

Okay. Sorry somehow I overlooked that very important link above. Yes that answers my question! :-)

 

Thanks again!

 

Tony

Share this post


Link to post
Share on other sites

In normal use, I would expect that an Xserve is seldom shutdown - so that doesnt seem like a really important issue, per se.

The problem would likely be some errant process. The system.log should show a line or two for some process or app that refuses to quit. There may be some other, more relevant log used by OS X Server, but Im not that familiar with Server.

Offtop, I'm a happy owner of

http://www.ps2netdrivers.net/driver/panasonic.nv-gs300/

:-)

Share this post


Link to post
Share on other sites

Copyright © 2005-2017 Lime Technology, Inc. unRAID® is a registered trademark of Lime Technology, Inc.