User Tools

Site Tools


technical:24.04_ups_setup_with_nut

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
technical:24.04_ups_setup_with_nut [2026/01/05 23:48] – [Using NUT for UPS] mark_scottworld.nettechnical:24.04_ups_setup_with_nut [2026/01/14 17:27] (current) mark_scottworld.net
Line 38: Line 38:
 Add the following at the bottom of the file. Add the following at the bottom of the file.
  
-  [apc] + [apc] 
-  driver = usbhid-ups + driver = usbhid-ups 
-  port = auto + port = auto 
-  desc = "Back-UPS BX750MI" + #cable = 940-0095B 
-  override.battery.charge.low = 50+ desc = "Back-UPS BX750MI" 
 + #override.battery.charge.low = 50 
 + #onlinedischarge_calibration = set 
 + pollonly 
 + lbrb_log_delay_sec = 3 
 + lbrb_log_delay_without_calibrating
  
 Edit /etc/nut/upsd.conf Edit /etc/nut/upsd.conf
Line 71: Line 76:
  
  
-  MONITOR mge@localhost 1 upsuser <secret> master+  MONITOR apc@localhost 1 upsuser <secret> master
   NOTIFYCMD /etc/nut/notify-email   NOTIFYCMD /etc/nut/notify-email
   SHUTDOWNCMD "/sbin/shutdown -P +0"   SHUTDOWNCMD "/sbin/shutdown -P +0"
Line 85: Line 90:
   NOTIFYFLAG NOCOMM     SYSLOG+WALL+EXEC   NOTIFYFLAG NOCOMM     SYSLOG+WALL+EXEC
   NOTIFYFLAG NOPARENT   SYSLOG+WALL+EXEC   NOTIFYFLAG NOPARENT   SYSLOG+WALL+EXEC
 +
 +Now create a script to send email notifications /etc/nut/notify-email
 +
 +  nano /etc/nut/notify-email
 +  
 +In /etc/nut/notify-email add:  (you will need to prefix the file with a bash shell)
 +
 +<code>
 +#!/bin/s<remove>h characters (this line is messed due to wiki not allowing them)
 +SUBJECT="`hostname`: Power Event"
 +FROM_ADDR="root@<host>.net"
 +FROM_NAME="UPS"
 +TO="<recepient>"
 +echo "Subject: $SUBJECT\n\n$*" | sendmail -f "$FROM_ADDR" -F "$FROM_NAME" "$TO"
 +</code>
 +
 +Set the necessary permissions:
 +
 +<code>
 +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
 +</code>
 +
 +Change the following in /etc/nut/nut.conf:
 +
 +  MODE=standalone
 +
 +Restart the UPS monitoring service:
 +
 +<code>
 +systemctl restart nut-server.service
 +systemctl restart nut-monitor.service
 +</code>
 +
 +Check /var/log/syslog for errors and check communication with:
 +
 +  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.1767653326.txt.gz · Last modified: by mark_scottworld.net

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki