Simple remote shutdown of truenas server

qschachi

Cadet
Joined
Oct 13, 2018
Messages
1
Hello,

I'm looking for a way to simply shutdown my TrueNas server in my own private LAN over my home automation system.

My Hardware Setup is like this:
A Smart-UPSX1500 which powers both my TrueNas Server and my Loxone Homeautomation system.

The UseCase is quite simple
If a grid power outage occurs which is longer than an amount of time (eg 15min) then the home automation system shall shutdown the TrueNas server since light in the house is more important then the a running server.

Since this is all in my private LAN network security does not really matter.

From the Homeautomation I easily can send HTTP commands - so a command like "http://pwd@usr:TrueNas-IP/shutdown" would fullfill the job to shutdown TrueNas in a safe way. (I will avoid the brute force method to add a smart socket to just cut the power to the TrueNas Server)

I was now searching for hours in a lot of forums (also this of course) how to achive this but without luck.

The best approach I found was the API system of TrueNas with the "system.shutdown" command.
So I've added an API key in the TrueNas UI but now?
I didn't figured out how I can use this API Key
Is there a way to send a HTTP command with this API key as authentication (since it is unique and only I know it) to shutdown the TrueNas server?

Thanks in advance for any ideas :smile:
 
Top