Shutdown FreeNas from Windows Server; script needed

Status
Not open for further replies.

tboneplayer

Cadet
Joined
Oct 13, 2012
Messages
2
I have one FreeNas server in a network of 4 servers and 2 desktops that support 75 user desktops. I have a script with clients that run on all the windows machines that will shut them down whenever the master UPS goes to battery power. What I need is a script I can run on one of the windows machines that would invoke the shutdown process on the FreeNas server. I have not been successful in locating such a script.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
I don't know of any elegant way to accomplish what you want. Here's how I would do it;

I'd setup the current script to create a file on a FreeNAS file share in the event that the UPS goes to battery power. Maybe something like "upstriggeredshutdown".

Then setup a cronjob in FreeNAS that runs every few mins(perhaps even every minute). If the file is found, delete it, then shutdown. Definitely delete the file BEFORE you shutdown otherwise you might bootup and the Cronjob will shutdown your server a minute later. ;)
 

ben

FreeNAS GUI Developer
Joined
May 24, 2011
Messages
373
Another Option: if the windows server has Cygwin, have the main windows script trigger a shell script to ssh to the freeNAS box and shut it down. Some security implications there.
 

tboneplayer

Cadet
Joined
Oct 13, 2012
Messages
2
Someone has suggested some elegant solution involving php, pear and ssh modules. He also mention IPMI support on the server. I sort of like the simplistic solution here. It would be easy to accomplish with the script in place now that notifies all the Windows systems to shutdown.
 
Status
Not open for further replies.
Top