technical:24.04_ups_setup_with_nut
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| technical:24.04_ups_setup_with_nut [2026/01/05 23:22] – mark_scottworld.net | technical:24.04_ups_setup_with_nut [2026/01/14 17:27] (current) – mark_scottworld.net | ||
|---|---|---|---|
| Line 23: | Line 23: | ||
| apcaccess | apcaccess | ||
| + | | ||
| + | NOTE: Currently this package is old and produces constant errors in the events log. - it may be better to use NUT | ||
| + | |||
| + | ==== Using NUT for UPS ==== | ||
| + | |||
| + | Install the required packages: | ||
| + | |||
| + | apt install nut | ||
| + | | ||
| + | Edit the ups.conf file. | ||
| + | |||
| + | nano / | ||
| + | | ||
| + | Add the following at the bottom of the file. | ||
| + | |||
| + | [apc] | ||
| + | | ||
| + | port = auto | ||
| + | # | ||
| + | desc = " | ||
| + | # | ||
| + | # | ||
| + | | ||
| + | | ||
| + | | ||
| + | |||
| + | Edit / | ||
| + | |||
| + | nano / | ||
| + | | ||
| + | Uncomment and modify the following lines. | ||
| + | |||
| + | MAXAGE 30 | ||
| + | LISTEN 127.0.0.1 3493 | ||
| + | MAXCONN 10 | ||
| + | | ||
| + | Edit the file / | ||
| + | |||
| + | nano / | ||
| + | |||
| + | Add the following to the end of the file. | ||
| + | | ||
| + | [upsuser] | ||
| + | password=< | ||
| + | upsmon master | ||
| + | | ||
| + | Edit / | ||
| + | |||
| + | nano / | ||
| + | |||
| + | Uncomment and set the following lines... | ||
| + | |||
| + | |||
| + | MONITOR apc@localhost 1 upsuser < | ||
| + | NOTIFYCMD / | ||
| + | SHUTDOWNCMD "/ | ||
| + | DEADTIME 20 | ||
| + | NOTIFYFLAG ONLINE | ||
| + | NOTIFYFLAG ONBATT | ||
| + | NOTIFYFLAG LOWBATT | ||
| + | NOTIFYFLAG FSD SYSLOG+WALL+EXEC | ||
| + | NOTIFYFLAG COMMOK | ||
| + | NOTIFYFLAG COMMBAD | ||
| + | NOTIFYFLAG SHUTDOWN | ||
| + | NOTIFYFLAG REPLBATT | ||
| + | NOTIFYFLAG NOCOMM | ||
| + | NOTIFYFLAG NOPARENT | ||
| + | |||
| + | Now create a script to send email notifications / | ||
| + | |||
| + | nano / | ||
| + | | ||
| + | In / | ||
| + | |||
| + | < | ||
| + | # | ||
| + | SUBJECT=" | ||
| + | FROM_ADDR=" | ||
| + | FROM_NAME=" | ||
| + | TO="< | ||
| + | echo " | ||
| + | </ | ||
| + | |||
| + | Set the necessary permissions: | ||
| + | |||
| + | < | ||
| + | chown root:nut ups.conf upsd.conf upsd.users upsmon.conf notify-email | ||
| + | chmod 0640 ups.conf upsd.conf upsd.users upsmon.conf | ||
| + | chmod 0750 notify-email | ||
| + | </ | ||
| + | |||
| + | Change the following in / | ||
| + | |||
| + | MODE=standalone | ||
| + | |||
| + | Restart the UPS monitoring service: | ||
| + | |||
| + | < | ||
| + | systemctl restart nut-server.service | ||
| + | systemctl restart nut-monitor.service | ||
| + | </ | ||
| + | |||
| + | Check / | ||
| + | |||
| + | upsc apc@localhost | ||
| + | | ||
| + | (You may need to reboot before the USB is allowed to talk to the UPS). | ||
| + | |||
technical/24.04_ups_setup_with_nut.1767651747.txt.gz · Last modified: by mark_scottworld.net
