yum -y install nut nut-client nut-cgiTas pats izveido useri nut(57) un grupu nut(57)
MODEL=apcsmartFix permissions (Fedora Core 2):
cd /etc/ups chown root:nut ups* chmod 640 ups*Configure /etc/ups/ups.conf
[myups]
driver = apcsmart
port = /dev/ttyS0
Configure /etc/ups/upsd.users
[monuser]
password = mypass
allowfrom = localhost 192.168.123.99
upsmon master
[admin]
password = admpass
allowfrom = localhost 192.168.123.99
actions = SET
instcmds = ALL
Configure /etc/ups/upsmon.confMONITOR 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 ACL trustedip 10.10.0.0/16 ACCEPT trustedip
# uncomment: I_HAVE_SECURED_MY_CGI_DIRECTORY/etc/ups/hosts.conf
MONITOR myups@upshost 1 monuser mypass masterOn 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>
$ 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: 07.08.2009
© 2004-2009 Ralfs