Skip to content

Instantly share code, notes, and snippets.

@aquette
Created March 1, 2013 22:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aquette/5068233 to your computer and use it in GitHub Desktop.
Save aquette/5068233 to your computer and use it in GitHub Desktop.
NUT on Solaris: USB information
Step by step guide to installing Network UPS Tools (NUT) with Solaris USB support.
CAUTION: this software is beta ...
1) Check and meet the pre requisites
------------------------------------
a) SUNWugen must be installed. It is part of the standard Solaris OS.
To check if it's is installed, use the following command from a terminal:
# pkginfo -i | grep SUNWugen
b) The SUNWlibusb and SUNWlibusbugen packages must be installed.
These are part of the standard Solaris OS 10 Update 2.
To check if these are installed, use the following command from a terminal:
# pkginfo | grep libusb
c) make
http://ftp.heanet.ie/pub/sunfreeware/pub/freeware/i386/10/make-3.80-sol10-intel-local.gz
2) Update your environment
--------------------------
a) Edit /etc/profile and add the following lines:
PATH=/usr/sfw/bin:/usr/ccs/bin/:/usr/local/bin:$PATH
export PATH
Then execute the following command:
# source /etc/profile
b) Verify that "/usr/sfw/lib" is in the dynamic linker
search path, using the following command:
# crle
If you don't see any reference to "/usr/sfw/lib", execute
the following command:
# crle -l /usr/sfw/lib
3) Compile and install the Network UPS Tools
--------------------------------------------
a) Unarchive the source code with the following command:
# gzip -dc nut-2.1.0-Solaris_USB.tar.gz | tar xvf -
Then goto the NUT source directory using:
# cd nut-2.1.0-Solaris_USB/
b) Configure the NUT using the command:
# ./configure --with-user=root --with-drivers=newhidups
Then compile the NUT using the command:
# gmake
Finally install the NUT using the command:
# gmake install && gmake install-usb
4) Configure your system for using NUT
--------------------------------------
a) Install the NUT startup script
Copy the file "nut.init" to /etc/init.d using:
# cp nut.init /etc/init.d/nut
Then create symbolic links for system boot and shutdown
# ln -s /etc/init.d/nut /etc/rc0.d/K99nut
# ln -s /etc/init.d/nut /etc/rc3.d/S20nut
This will ensure that UPS protection is started and
stopped at Solaris bootup and shutdown time.
b) Create the NUT runtime data directory using the commands:
# mkdir -p /var/state/ups
# chmod 0770 /var/state/ups
# chown root:root /var/state/ups
c) Bind MGE units to Solaris USB /Ugen layer using:
# add_drv -i '"usb463,ffff.1"' -m '* 0660 nut root' ugen
# update_drv -a -m '* 0666 root sys' -i '"usb463,0001.1"' ugen
# reboot -- -r
5) Configure NUT
----------------
a) Unarchive the content of nut-config.tar.gz into /usr/local/ups/etc
# cd /usr/local/ups/etc
# gzip -dc nut-config.tar.gz | tar xvf -
b) Modify files permission using:
# chmod -R 0660 ./
# chown -R root:root ./
6) Test installation
--------------------
- start daemon using:
# /etc/init.d/nut start
- Wait a bit for the system to be initialized (~ 30 seconds)
and call teh command:
# /usr/local/ups/bin/upsc mgeups@localhost
You will have an output like:
battery.charge: 100
battery.charge.low: 30
battery.runtime: 4100
driver.name: newhidups
driver.parameter.pollfreq: 60
driver.parameter.port: auto
driver.version: 2.1.0
driver.version.data: MGE HID 1.0
driver.version.internal: 0.30
ups.delay.shutdown: -1
ups.delay.start: -10
ups.load: 0
ups.mfr: MGE UPS SYSTEMS
ups.model: Pulsar Evolution 500
ups.status: OL CHRG
...
Notes:
------
- the default NUT behaviour is to maximize runtime, so
in case of power failure, the NUT will shutdown the
system when the UPS remaining battery charge reaches
30 %.
- Power failure and restoration are notified through
Wall message (console broadcast).
- NUT is software libre, released under GPL, and
supported / sponsored by MGE UPS SYSTEMS.
More information can be obtained at: http://www.networkupstools.org/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment