Register for the iXsystems Community to get an ad-free experience

Need script to run shut down command to freeNAS over network

Status
Not open for further replies.

patrick sullivan

Contributor
Joined
Jun 8, 2014
Messages
117
I am wondering if anyone has written a script to run a shutdown command from a Windows PC to a FreeNAS server? I have two NAS on my network and both are attached to my UPS. I have no way to send a signal from the UPS to both units. My understanding is that the only way around it is to have a command sent from a workstation (connected directly to the UPS) to devices on the network. Moderators: I realize that this is not 100 percent freenas related, but it does pertain to my freenas server. :)
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
I did this about 2 years ago for a friend. Sadly that setup doesn't do this anymore so I can't get you the exact command. But there's a program called plink that is nothing more than a simple SSH program and you can setup a batch script to run plink and send a command. You send "shutdown -p now" and the box will poweroff on its own.
 

patrick sullivan

Contributor
Joined
Jun 8, 2014
Messages
117
Thanks cyberjock. Any chance of a guide anywhere? I don't trust my limited knowlege in this area.
 

DJ9

Contributor
Joined
Sep 20, 2013
Messages
183
If you have a APC ups with a expansion card you can use apcupsd and it will shutdown multiple systems.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
No guide. I figured it all out myself. Took about an hour of Googling and a little experimenting. Not to hard if you are good at figuring stuff out. ;)
 

patrick sullivan

Contributor
Joined
Jun 8, 2014
Messages
117

Ericloewe

Not-very-passive-but-aggressive
Moderator
Joined
Feb 15, 2014
Messages
18,380
Shouldn't NUT do this? What am I missing?
 
Status
Not open for further replies.
Top