FreeNAS 7 - see link at the top of the forum. This site is for FreeNAS 8.
Originally Posted by JimL
If you were on FreeNAS 8, and since I'd already typed this out before noticing you were on FN7 I may as well let it stand... you'd need to hack a change into /etc/local/nut/upsmon.conf, replacing the default shutdown command with your own script (that would also end with a "shutdown -p now"). Though as this conf file is rewritten from the database, it would require modifying the script that creates upsmon.conf, which is /etc/rc.d/ix-ups (modify the /conf/base version to keep the change across boots).
Perhaps as an enhancement you should open a ticket requesting that the default shutdown command can be changed via the GUI.
The changes for FN7 are probably similar - find the post on the FN7 forum detailing how to get network UPS support working in FN7, and it should give you all the clues you need.
I've got a UPS running with a Windows Server based computer managing the UPS.
The UPS I've got is a APC Smart-UPS (SUA1500) which comes bundled with their own tool for Windows. That tool allows a shutdown script.
The shutdown script I created for my FreeNAS box which I also use for Linux servers is as follows:
I use Ps exec to run Plink (which is a commandline tool for PuTTy) to SSH into the box and execute a single command then return.
It executes the shutdown now -p command on all the servers. In the BIOS of the servers I've set the: On AC Power Loss option to Power On. (eg. if the PSU loses power and comes back online, start up automatically).
Before that I experimented with other options, I tried creating a Java application that could shutdown the server using the web-interface but it was unreliable. Same happened with PHP. FreeNAS 8 uses AJAX which significantly complicates the problem. You have to log in first then send the command to the web-application. You can catch the actual AJAX that it sends using FireBug.
If you used WinNUT on the Windows server (aka master) you could connect the UPS to the FreeNAS server (as master) and run the Windows Server as the slave - just enable "Remote Monitoring" in the FreeNAS UPS config. No hacks or remote command execution required.
Originally Posted by Gnome
NUT (Network UPS Tools) is designed to avoid just the kind of hacks you have employed. All servers on the network that support NUT monitoring would automatically shutdown once configured to monitor the network for UPS related events.
Thanks I'll give it a try. So I can still run WinNUT on Windows? Reason being the FreeNAS system can't really have the UPS connected to it.
Originally Posted by Milhouse
Is it possible to run a UPS remotely in FreeNAS 8? I'm still on 7 but I'll be upgrading soon, however I don't see the remote option in the 7 GUI?
Last edited by Gnome; 11-02-2011 at 07:11 AM.
According to the WinNUT page it is a partial port of NUT and supports network monitoring only (ie. slave mode), so it doesn't appear as though WinNUT will act as the master to monitor a locally connected UPS.
Originally Posted by Gnome
However if you look at the NUT download page, there is a Windows MSI installer labelled as "complete port" in the binary packages section (released July 2011) that might be worth investigating.