FreeNAS & Plex - Foolproof instructions for Wake On LAN (WOL)?

Status
Not open for further replies.

TheWoo

Explorer
Joined
Jan 2, 2015
Messages
58
I have to admit that I'm a Mac guy since 1989 and on there consider myself being a power user. However, I've never touched Windows unless inevitable (using it for certain 3d printing purposes and CAD) and only have some very basic Unix knowledge. So anything but a Linux or FreeBSD expert. Still I've managed to built my own FreeNAS, and happily use it as Plex Server and Time Machine Backup Server.

Could anyone explain me with some fool-proof instructions on how to enable Plex-specifical Wake On LAN (WOL), so that the FreeNAS powers up as soon as a Plex client in the local networks tries to contact the Plex Media Server and shuts down again if there hasn't been a streaming request for let's say 15 minutes?

My FreeNAS is using an ASRock E3C226D2I Server Motherboard which supports WOL, and which I can power up and down via the browser-based IPMI on the second Ethernet port. Software versions are FreeNAS-9.10-STABLE-201604261518 (881b70d) and Plex Media Server plugin 0.9.16.4.1911.

If the automated ON and OFF via WOL isn't possible, is there alternatively the option to power the ASRock E3C226D2I up and down using http-commands?

Thanks in advance!
 

pirateghost

Unintelligible Geek
Joined
Feb 29, 2012
Messages
4,219
Powering your server off and on frequently is more wasteful than leaving it on 24/7. It's also more harmful on the hard drives and your server doesn't get an opportunity to run its maintenance tasks
 

TheWoo

Explorer
Joined
Jan 2, 2015
Messages
58
@dlavigne Nope, no help/instruction yet. Also posted the question in the Plex Forums.

@pirateghost I use my FreeNAS really only occassionally to watch a movie or to run a backup. Total time of usage is perhaps 2-5% (4-8 hrs per week), so it really makes little sense to have the system running 24/7/365.
 

raidflex

Guru
Joined
Mar 14, 2012
Messages
531
You are better off storing the content on dedicated Plex server if your usage is so infrequent. I would just run a Plex server/client on PC that is connected to the TV. Or you might have better success with Kodi. I would check the Plex forums though for more information on the WOL feature.
 

TheWoo

Explorer
Joined
Jan 2, 2015
Messages
58
Setting up another server is not an option. If WOL is not feasible, can anyone tell me if there is a proper (read: non-dangerous) shut-down HTTP command, which either talks to the FreeNAS server app or the ASRock IPMI? Same for power-on (again: I can already already power on the server through the browser-based ASRock IPMInterface).
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,553
Setting up another server is not an option. If WOL is not feasible, can anyone tell me if there is a proper (read: non-dangerous) shut-down HTTP command, which either talks to the FreeNAS server app or the ASRock IPMI? Same for power-on (again: I can already already power on the server through the browser-based ASRock IPMInterface).
http://api.freenas.org/resources/system.html#shutdown
 

TheWoo

Explorer
Joined
Jan 2, 2015
Messages
58
I'm terribly sorry, but I have little to no coding knowledge. Basic HTML knowledge only. Can you explain me on how to turn that shutdown command into a URL? Do I put those command lines into an executable .html file which I then call? If so, exactly where to place that file!? o_O
 

pirateghost

Unintelligible Geek
Joined
Feb 29, 2012
Messages
4,219
I'm terribly sorry, but I have little to no coding knowledge. Basic HTML knowledge only. Can you explain me on how to turn that shutdown command into a URL? Do I put those command lines into an executable .html file which I then call? If so, exactly where to place that file!? o_O
You would probably use some JavaScript or (shudder) php to write it...
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,553
You would probably use some JavaScript or (shudder) php to write it...

I think the below python script would do it (I don't mess with the API personally):
Code:
import requests

print requests.post(
          'http://192.168.0.42/api/v1.0/system/shutdown/',
          auth=('root', 'password'),
)


Of course, plug in your own IP-address and password.
 

TheWoo

Explorer
Joined
Jan 2, 2015
Messages
58
Thanks a lot @anados, but that python script is exactly stored where? Sorry, but I have really way too little knowledge about web programming...
 

pirateghost

Unintelligible Geek
Joined
Feb 29, 2012
Messages
4,219
Thanks a lot @anados, but that python script is exactly stored where? Sorry, but I have really way too little knowledge about web programming...
You would put it wherever you want to run it from. It doesn't need to be on the FreeNAS box....
 
Status
Not open for further replies.
Top