yum -y install nut nut-client nut-cgiInstall make user nut(57) and group nut(57)
MODEL=apcsmart DEVICE=/dev/ttyS0Fix permissions (Fedora Core 2):
cd /etc/ups chown root:nut ups* chmod 640 ups*Configure /etc/ups/ups.conf
# /etc/ups/ups.conf
[myups]
driver = apcsmart
port = /dev/ttyS0
Configure /etc/ups/upsd.users# /etc/ups/upsd.users [monuser] password = mypass upsmon master [admin] password = admpass # No more in Fedora 12: #allowfrom = localhost 192.168.123.99 actions = SET instcmds = ALLConfigure /etc/ups/upsmon.conf
# /etc/ups/upsmon.conf MONITOR myups@localhost 1 monuser mypass master # reboot, not halt and after 1 minute SHUTDOWNCMD "/sbin/shutdown -r +1" # If you wish: NOTIFYCMD /usr/local/bin/upsnotify # Notify messages: NOTIFYMSG ONBATT "I'm on battery only :( %s" NOTIFYMSG LOWBATT "My battery is too low :( %s" NOTIFYMSG SHUTDOWN "Going down... %s" # NOTIFYFLAG - change behavior of upsmon when NOTIFY events occur NOTIFYFLAG ONLINE SYSLOG NOTIFYFLAG ONBATT SYSLOG+WALL+EXEC NOTIFYFLAG SHUTDOWN SYSLOG+WALL+EXEC ### NOTIFYFLAG LOWBATT IGNORE
# /etc/ups/upsd.conf LISTEN 127.0.0.1 LISTEN 192.168.123.99Determines which part of the NUT is to be started
# /etc/ups/nut.conf MODE = netserver
MONITOR myups@upshost "Host Description"/etc/ups/upsset.conf
# uncomment: I_HAVE_SECURED_MY_CGI_DIRECTORYOn http box configure apache:
ScriptAlias /nut /var/www/nut-cgi-bin
<Location /nut>
Order deny,allow
Deny from all
Allow from 127.0.0.1
Allow from 192.168.123.21
AuthType Basic
AuthName "Password Required"
Require valid-user
AuthUserFile /etc/httpd/passwd
Satisfy Any
</Location>
Web access:$ service ups start # or $ /etc/init.d/ups start $ grep ups /var/log/messages $ ps ax|grep upskomandas:
$ upsc myups@localhost $ upscmd -l myups@localhost
upslog -u nut -s myups@localhost -l /var/log/ups.log
Back to Home: Ralfs Home Page
Last modified: 18.01.2011
© 2004-2011 Ralfs