Setting up NUT for UPS

So in my rack, I use a Back-UPS RS 1000G-IN with Battery Extension Pack to keep powering through the outages or power fluctuations. While the society has DG, switch over can take up to a minute and then UPS helps achieve that.

I watched a Jeff Geerling Video which discussed his outage and nut setup. And I thought this might be useful for me as well:

There is another video from him on this BTW:

My setup was also quite simple, with 1 node being the master and another 11 being clients. For new client, the setup is quite simple:

sudo apt-get install nut-client

# Add following  to /etc/nut/upsmon.conf

RUN_AS_USER nut
MONITOR apc@x.x.x.x 1 username password slave

sudo systemctl enable --now nut-client

For server, the setup is a bit longer:

sudo apt-get update
sudo apt-get install nut-server nut-client

Edit /etc/nut/ups.conf:

[apc]
    driver = usbhid-ups
    port   = auto
    desc   = "APC UPS"

Then /etc/nut/upsd.conf:

LISTEN 0.0.0.0 3493

Then /etc/nut/upsd.users:

[monuser]
    password   = your_pass_here
    actions    = SET
    instcmds   = ALL

Then /etc/nut/upsmon.conf:

RUN_AS_USER nut
MONITOR apc@localhost 1 monuser your_pass_here master

Finally

sudo systemctl enable --now nut-server nut-monitor
upsc apc@localhost
upsrw -s battery.charge.low=15 -u admin -p yourpassword apc@localhost # Change Charge Low Threshold
upsrw -s battery.runtime.low=300 -u admin -p yourpassword apc@localhost # Change Runtime Threshold