Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: General UPS questions

  1. #11
    Super Moderator
    Join Date
    Jun 2011
    Posts
    545
    Quote Originally Posted by JimL View Post
    Any spesifics on how to actually run a command when freenas starts a ups forced shutdown? Running Freenas7

    I know I can add them to command scripts - shutdown, but would be better to run it on ups-shutdowns only.
    FreeNAS 7 - see link at the top of the forum. This site is for FreeNAS 8.

    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.

  2. #12
    Member
    Join Date
    Aug 2011
    Location
    Cape Town, South Africa
    Posts
    53
    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.

  3. #13
    Super Moderator
    Join Date
    Jun 2011
    Posts
    545
    Quote Originally Posted by Gnome View Post
    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:
    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.

    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.

  4. #14
    Member
    Join Date
    Aug 2011
    Location
    Cape Town, South Africa
    Posts
    53
    Quote Originally Posted by Milhouse View Post
    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.

    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.

    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.

  5. #15
    Super Moderator
    Join Date
    Jun 2011
    Posts
    545
    Quote Originally Posted by Gnome View Post
    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.
    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.

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •