NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
Infinite
Nov 15, 2009Aspirant
NUT on OSX 10.6 [Sharing a UPS with ReadyNAS and Computers]
First off: I can not take much credit for this post, the majority of this write up was done by Egg in this post "NUT on OS X (10.5.7)" which was priceless in my effort to get this matter solved. It ...
StarkJohan
Sep 14, 2014Aspirant
I know this is an ancient thread but I stumbled upon it when searching for info on monitoring my UPS connected to my ReadyNAS from my Mac OSX server (it's actually a Macbook Pro with the internal battery removed). I wrote this little applescript to be able to properly shutdown the mac and to work just like the ordinary UPS shutdown options would. I thought maybe someone else would be happy to find this post so here goes.
Some info from the script:
Remember to change the settings to match your preferred setup in the main script. (Show package contents).
Download:
http://www.snutt.net/readynas_ups_monitor/ReadyNAS%20UPS%20Monitor.zip
Some info from the script:
(*
Quick and dirty script for remote OSX UPS monitoring, Beta version 0.5.5
Johan Samuelsson - johan@snutt.net
Feel free to use and edit this script to fit your needs.
Tested on my ReadyNAS Pro 6 using the APC Back-UPS ES 700G
I assume it will work for most readynas units running the radiator firmware but I cannot confirm this.
The xml might be different on other models but that would probably just mean slight adjustments to the script.
Two main reasons made me create this script
1. Macs supporting internal batteries (macbooks) cannot handle UPS units properly even if the battery has been removed from the computer. Shutdown options are disabled in the "Energy Saver" pane. Using pmset from terminal you'll be able to set the ups settings (haltlevel, haltafter, haltremain) but to my knowledge the system will ignore them anyway.
2. Setting up klunky package managers as macports or fink just to install NUT just to do what can be accomplished in a simple AppleScript annoys the heck out of me :-)
More info on pmset: https://developer.apple.com/library/mac/documentation/Darwin/Reference/Manpages/man1/pmset.1.html#//apple_ref/doc/man/1/pmset
More info on NUT: http://www.networkupstools.org
*)
(*
Config variables
*)
set haltlevel to 60
set haltafter to 0
set haltremain to 5
(*
haltlevel - When draining UPS battery, battery level at which to trigger an emergency shutdown (value in %)
haltafter - When draining UPS battery, trigger emergency shutdown after this long running on UPS power (value in minutes, or 0 to disable)
haltremain - When draining UPS battery, trigger emergency shutdown when this much time remaining on UPS power is estimated (value in minutes, or 0 to disable)
*)
set recipientName to "Johan Samuelsson" -- Mailing errors/messages
set recipientAddress to "johan@snutt.net" -- Mailing errors/messages
set emails to 1 -- Set to 1/0 to turn on/off emails
set notifications to 1 -- Set to 1/0 to turn on/off "normal status" notifications
set readynasIp to "10.0.1.1"
set user to "admin"
set pass to "password"
set shutdownDelay to 30
set checkFrequency to 15
set tempFile to "/tmp/readynas.xml"
Remember to change the settings to match your preferred setup in the main script. (Show package contents).
Download:
http://www.snutt.net/readynas_ups_monitor/ReadyNAS%20UPS%20Monitor.zip
Related Content
NETGEAR Academy

Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology!
Join Us!