A service of Daily Data, Inc.
Contact Form

User Tools

Site Tools


software:truenas:ups
no way to compare when less than two revisions

Differences

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


software:truenas:ups [2023/11/23 06:57] (current) – created - external edit 127.0.0.1
Line 1: Line 1:
 +====== Setting up a UPS with TrueNAS ======
 +
 +TrueNAS supports monitoring UPS' using the open source [[https://networkupstools.org/|Network UPS Tool]] (aka NUT). While they have done a good job of automating discovery, sometimes it is difficult to figure out which device is which when a UPS is plugged into a USB port.
 +
 +===== Find UPS plugged into a USB port =====
 +
 +The command <code bash>usbconfig</code> is your friend here. In this real life case, I found the Cyberpower PR1500 plugged in at ugen0.4.
 +<code>
 +ugen0.4: <CyberPower Systems PR1500LCDRTXL2U> at usbus0, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON (50mA)
 +</code>
 +
 +It is on bus 0, port 4, so look for the direct link to that. It will either be called ugen* or uhid* in /dev
 +
 +<code bash>ls -ablph /dev/ugen* ; ls -ablph /dev/uhid*</code>
 +
 +This shows all entries named ugen* or uhid*, with the link that it actually points to.
 +
 +<code>
 +lrwxr-xr-x  1 root  wheel     9B Nov 18 17:55 /dev/ugen0.4 -> usb/0.4.0
 +</code>
 +
 +So, the device it is hooked up to is /dev/ugen0.4.
 +
 +===== Setting up the UPS =====
 +
 +Open the TrueNAS WebUI and go to Services, then Actions for UPS
 +  - Identifier: ups (or anything you want)
 +  - UPS Mode: Master
 +  - Driver: find something close. For my PR1500, I used PR6000
 +  - Port: auto (or choose ugen0.4 that you found above)
 +  - Shutdown: UPS goes on battery
 +  - Shutdown Timer: 600 (seconds, or 10 minutes)
 +  - Save
 +
 +===== Testing =====
 +Start the UPS service. You can now drop to the shell and run the command:
 +
 +<code bash>upsc ups</code>
 +
 +where 'ups' is the name you chose as Identifier.
 +
 +If it all appears to be working, put a check for Automatically start. NOTE: you can view some stats on the UPS under Reporting.
 +
 +===== ipmi shows a difference =====
 +
 +If you use ipmitool to display the amount of power the server is using
 +
 +<code bash>ipmitool sensor</code>
 +
 +You might see a different number than the power your UPS is showing with <code bash>upsc ups</code>.
 +
 +First, ipmitool is probably showing //Watts// while the UPS may be showing //Volt-Amps// (VA). In an AC circuilt, these can be different.
 +
 +Second, your UPS uses additional power to keep the batteries topped off, and also just for some internal circuitry, so it should show a different power (higher) than what your server actually uses.
 +
 +On my setup, with a Cyberpower UPS powering an older Dell server, I used the command:
 +
 +<code bash>
 +ipmitool sensor | grep 'Power Meter' | cut -d'|' -f2
 +upsc ups | egrep 'ups.load|ups.realpower.nominal'
 +</code>
 +
  
software/truenas/ups.txt · Last modified: by 127.0.0.1