Thanks for a great and thorough video Tim. I was trying to do this for my home network because I have more devices than UPS units. Like some others have commented here, I too wanted to protect a pfsense firewall and some Synology NASes. I'm happy to report this worked like a champ! For the benefit of others I thought I would add a couple of things that worked for me to get those two things working. 1. PFSense: install the NUT application. Then under Services/UPS/Settings, select 'Remote NUT Server' from the dropdown and enter your IP address, user name and PW that you defined on the NUT server in Tim's video. 2. Synology: I read elswhere that Synology expects the UPS to be named 'ups' so that's what I did in the conf files that Tim walks us through in the video. Don't name it anything else and I kept it lowercase. Then on the Synology, go to Control Panel/Hardware & Power/UPS and select 'enable UPS Support' , choose 'Synology UPS Server' and enter the IP in the field that asks for it. No user name or PW is required here. Hope this helps others!
Excellent tutorial. Two things of note when it came to my installation. On the client (Ubuntu in my case) the CMDSCRIPT is generated in /usr/bin/upssched-cmd and should be edited from there. So sudo nano /usr/bin/upssched-cmd. Next in your example there is not command to stop the earlyshutdown timer if power comes back on. So I added AT ONLINE * CANCEL-TIMER earlyshutdown to the upssched.conf. All working well after that.
9 месяцев назад+2
thanks for mentioning, without this bit the configuration showed basically shutdowns your system down on any power event even if the power returns immediately
This was actually something I was really curious about. Safely shut down servers and Nas servers to prevent corruption, separate modem / router so they last longer on battery backup. This explains how it can be done. Thanks!
Thanks for another great video. In case anyone is trying to set up a CyberPower UPS, I was having an issue with disconnects and stale data. The fix was to change the setting pollinterval = 15 in the /etc/nut/ups.conf file. My particular model is CP1500PFCLCDa.
I said that before I will say it again, you rock! One of the best channels for us homelabers, of any level. Meticulously crisp and clean explanations, I can only imagine how much effort and sweat goes into production of this. And I want to sincerely thank you for this. It really shows how much you love you put in what you do. Also I have been trying to set up NUT tools on an RPI before and gave up because it kept breaking. My stupid fix was to setup a systemd timer task to restart the docker container in which NUT server ran every 5 minutes lmao. Will definitely give that UDEV rule a try.
Love your videos! I built two Proxmox boxes with old hardware just lying around thanks to your tutorials and have consolidated 5-6 NUCs into one machine, and another running PBS. I've also been using NUT servers for my two CP1500EPFCLCD units for a few weeks now. on my Proxmox machine It was pretty complex to set up, but the results were very rewarding. It runs a script to SSH into my main Windows machine and shuts down any GPU intensive processes so the battery lasts longer, and shuts it down safely once battery hits a certain threshold. Invaluable stuff, and thanks for all the amazing content for this very addictive and very dangerous (for my wallet) hobby! :D
That gives me an idea. I participate in the folding@home project and having my PC running off my ups would drain it faster if it was just folding. I wonder how you got it to work like that and I wonder if I can take it farther by saving and closing apps that are not critical, changing power plan to use as little power as possible, and what not. I just don't know how at the moment.
To delete the contents of a file with nano, press cntrl + t then cntrl + v. Just looked this up and its a major time saver. I also create a directory called `examples` and move all the files I plan on modifying. Saves a few keystrokes. Thanks for the great content! You make homelabbing more enjoyable!
This was great. And very well done. Unlike many long tutorials on YT, this one was very easy to follow along. I have brought up 2 NUT servers so far, monitoring 7 devices, and plan to bring up a couple more. Thank you SO much for your time and for sharing this.
A couple things to note on the upsmon configuration: The number for the UPS is the support value. This is usually 1 for UPSs that supply power to this device and 0 otherwise. This works with the MINSUPPLIES value. If you have two separate power supplies, each fed from a separate UPS (and you don't need both supplies to support this device), each of the UPSs will have the 1. I was monitoring a UPS for my network stack from a server (router) fed from a UPS that does not have monitoring (actually a 12 VDC battery). I figured out what was happening when the UPS shut down, and the router shut down shortly after (when DEADTIME expired). And since the shutdown was commanded, it did not power back up automatically when the power came back. I need to configure something like what you have, but I will also feed some of the metrics to Grafana.
something to mention about this config which i had to changed a few things, i have configured Host 1 and Host 2 in a cluster to power down after 3 mins but i simulated a Powercut for around 30 seconds however the timer does not stop and the timer will carry on with the shutdown process regardless of Power online. Not sure how much testing you have done but this is what I found, The config which fixed this is, CMDSCRIPT /etc/ups/upssched-cmd PIPEFN /etc/ups/upssched.pipe LOCKFN /etc/ups/upssched.lock # Once any UPS goes on battery, delay turning off the beeper by 5 seconds AT ONBATT * START-TIMER beeperoff 5 # Once any UPS goes on battery, delay executing "earlyshutdown" with 120 seconds AT ONBATT * START-TIMER earlyshutdown 120 # If any UPS comes back cancel the "earlyshutdown" if not yet fired AT ONLINE * CANCEL-TIMER earlyshutdown # If battery is critical shutdown immediately AT LOWBATT * EXECUTE shutdowncritical
I got a smoking deal on an older revision of that exact Tripp Lite 1500 (no LCD screen) and was having the worst time trying to get it to play nice with the NUT utility in pfsense and was gettign no where following text guides. 24 minutes of your video later and it works perfectly. Thanks for such a great guide!
The best walkthrough on how to setup nut server and clients. I set up a UPS (with a raspberry pi), three Proxmox hosts and an OMV NAS on first attempt. Much appreciated!
Huge Follower of your work over the years, but this video for me and the detailed data and explanation to adding a UPS to NUT and a webUI and local host was one of the best. What an amazing Video. I was following everything you did, but with a Cyberpower unit. Was able to integrate into HA with no issues - then later added the WebUI to Heimdall as well for fast access. Thanks again Tim
Thanks a ton for this. I'm setting up monitoring of my dad's solar power system on a UPS, and I never have time to spend on it when I'm there, and I know this isn't the right way to set up a long-term system... But I'd followed a couple writeups and kept having errors, and figured I'd have to find time to fully read the documentation and start over. Finally having a few min to relax and started looking for docs, and found this video. It's running exactly as it should now. I added the NUT-UPS node in NodeRed, and I can check his power or get outage alerts at my house, 2 states away. Thanks for the good work.
I wish you brought up how clients will start again after power is back. For me this critical as I don't always have physical access to my labs. Other than that, great video! You bring up so much useful info in a very approachable matter without dragging it too long. Recent subscriber and binge watcher here
This is something you set in the BIOS, you would have to have the option of power-on when power is restored or have Wake-On LAN enabled in the BIOS as well
I’ve had this question for some time, especially for when I’m travelling. Even though my BIOS is set to power on whenever power is switched in, it does not cover a scenario when the line power returns before the UPS battery is fully depleted. This probably means that the power to the board was never cut. Or is there a way to switch off all output from the UPS and force a power cycle to leverage the BIOS feature?
I’ve always pronounced dmesg as “D message” since it displays messages from the kernel. Also great video! I have a couple UPS’s at home in a similar setup as you, split to handle different sets of gear, and only did a little messing around with NUT to view some info from one of them, but never finished really properly setting it up. This was all great info and gave me the kick to go and finish actually setting it all up. Thanks!
I have NUT server running on my Unraid server with a Cyber Power UPS connected via USB. NUT server is started, recognizes the UPS and displays its status just fine in Unraid. I have the WinNUT client running on a windows box but I could not get it to connect to the NUT server. I was banging my head on the table for about a week until I came across this video... I had the polling interval setting in WinNUT set to 0 which is the default. Once I changed it to something other than zero it connected and the UPS status populated just fine (duh moment). The lower the number, the more "chatty" it is on the network. I believe the setting is called "Delay" on older versions of WinNut. As far as I can tell from Wireshark the NUT server doesn't broadcast, it just listens on port 3493 and responds to queries from NUT clients on the network. Glad it was something super simple.
This is exactly what I needed!!! Same setup as you, with the same use case so this is just awesome! Great tutorial. Loved the long format since it gave us more details which your other videos always has me digging online and through documentation. I'm a programmer! I am tired of looking through documentation from work. I don't need it on my free time too. Sorry just a little rant... Awesome work!
To get a clean configuration file, just run "mv file.conf file.example.conf" and then "nano file.conf" This will rename the original file and let you create a clean file. You might want to verify permissions attributes though...
Been doing some big changes to my home network. Just used this tutorial to setup NUT on a Pi4, with an Eaton 5S UPS. Then configured my QNAP NAS as a slave (that was a little detour from your all NUT server client setup, it has hard coded users and password that I couldn't find to change but some other sites gave the low-down.) Also setup WinNUT on the Windows 10 workstation (also gaming and plex server machine) Whilst I was at it I setup gravity sync (docker containers for pihole on the QNAP as master the Pi4 and secondary. Thanks for your awesome channel.
One thing that you could improve is to explain the difference between server and client (I hope I didn't miss it.) Server is the one c9mputer, which is connected directly to the ups ising USB port, and clients are using UPS but are not connected to the UPS directly via USB or serial ports like other physical servers, virtual boxes. Again, excellent, very detailed instructional video. Thanls.
After watching this I was able to setup my Synology NAS as a NUT server to auto shut down my Linux box and Win 10 machine. Obviously made a lot of tweaks, but I learned a lot about setting up the config files. Thanks!
One of the best tutorials I have ever watched. I mentioned about you on my channel. Additionally you can run the home assistant in a container through the docker compose and add NUT panel there.
Thank you so much Tim. I was going NUT trying to figure out how to get this to work.. But as sent from the sky, you just explained it in the best way. Keep up the good work.
Thank you so much for this! I have spent so many countless hours of frustration trying to configure NUT in my homelab. I had mostly given up trying to make it work how I wanted.
Excellent video, loved it! One thing I do differently for servers is have the server automatically power on once the power has returned. That is the purpose of the powerdown flag file. To do this type of setup you need to change a setting in the bios so that power to the server will cause it to automatically turn on and you need to send the fsd command to the ups during the shutdown routine so that you ensure the file system is ready to poweroff. I will get more info if anyone is interested. It was setup a while ago so I need to review the config files.
I've got a couple of Dell servers and wouldn't mind setting this so that they come back up once power is restored. I'll have to poke around in the BIOS.
Was pulling my hair out trying to get my Proxmox server to shutdown as a NUT client. Followed your instructions and worked straight away! Like you I cheered when I got it working lol 👍
Thanks -- great guide and very clear!! I'm neither a network nor a linux guy, but managed to get things up and running, modify the firewall in my UDM Pro to allow cross-VLAN communication for just the one RPi to the other RPi and feed the data to my Home Assistant installation. Brilliant!! I'm surprised that it work, and gratified that it did!! Now I'll go on and look at the rest of your stuff....
Thanks for you tutorial. I watched three times and spend 12hrs, and finally have my NUT server VM up and running. My pfsense VM and 2x Synology DSMs (running surveillance station) successfully connect to the server! :D
Thanks for the great informative video, I've been trying and giving up on NUT for three years. after watching your video and going back to the video a few times I have NUT integrated into Home Assistant monitoring my media/home assistant PC UPS and have a Pi Zero running Debian running NUT for my desktop's UPS.
I really appreciated this video. I just found out about NUT and this helped me set it up on my Synology and add a Windows 10 client. Happy i don't have to rush to shut down my NAS now during a power outage.
Thanks for a really great video! I didn't need to setup a NUT server, since I am using the built-in 'UPS Server' that came on my QNAP NAS devices. The QNAP is easy to set up, has several more security-focused settings, and it integrates flawlessly with NUT Clients like my pfSense appliance. The part I needed the most was towards the end of the video that talks about setting up the NUT Clients. I have several servers running Red Hat, and found where NUT puts the files on a RHEL machine differed from your video... so I had to hunt the files down. I'm still not there yet with setup and testing, but your video helped me A LOT, and got me pointed in the right direction. For that; I thank you.
Great tutorial. I was not only able to configure NUT on my SuperMicro server but also able to set up my Netgear ReadyNAS's with UPS monitoring. Next I'll get it going on my Plex server and will be fully protected. Many thanks.
I was trying to figure out something similar to this 6 months ago. I gave up since I couldn't get it to work. I may give it another go with this guide since this covers some things I was unaware of. You sir got yourself a sub!
Hey Tim, Thanks for the video. Due to the weather, we had a few blackout of a few hours in the last month. All my device survived the abrupt power-off when the UPS run's out for years. Well, there are always exceptions and one VM in particular, my Active Directory by the way :) started to act bizarre. And then, I discovered other VM's in a similar fashion. I ended-up rebuilding the whole host server. No data loss but a waste of time to rebuild. As for the AD, a snapshot save the day. So, I started looking for solutions. Since I don't have thousands of dollars to spend on UPS's, (all of mine are similar to your), yes, they are USB ;). I needed something fairly cheap, even if I needed to roll-up my sleeves :D I came across your channels and in particular, this video. Thanks a TON, my setup, at a high level is the following: I run a few servers, switches, NAS, SAS, etc. in my main lab room. Some equipments have dual power supply so I've got two APC UPS's (with external battery) on their dedicated circuit. I also have two other UPS in two separate rooms. I will have these reached-out the main nut server via USB over ethernet cable device later n the week (to be tested). My nut server will be in the main room of course. Four UPS's in total to monitor. I run VMware, Proxmox, QNAP, TrueNAS (with a EMC SAS), and a bunch of networking gear for the company I work for. So, I'm basically running a config like the one you uses. I will be looking to shutdown machine that doesn't support the nut-client (through ssh) in the next days (seeks), as time permit. Keep-up the good work ;) Cheers! By the way, I'm receiving similar message from your TripLite on the nut server from my APC UPS's (UPS lab-right@localhost is unavailable)...
First of all thanks for this video: it was so useful for my proxmox + notebook configuration. Anyway, I have to notice that user definition is a bit different from what reported in documentation. In upsd.users we have to setup at least one user for administration, and you cannot find anything about in domentation: you obtain this with the "admin" specification, like you should do for "upsmon". Moreover, documentation speaks about primary and secondary, but for real you must use master and slave. Regards.
YESSS. I've been running apcupsd, and a grafana dashboard, but I've been having a hard time finding the motivation to dive into getting things to gracefully shut down.
Thanks. After been using NUT for a bit of time in very basic ways, figured I should look for some videos to do a better and proper setup. I have computer in a few places and also several UPSes in a few places. In my so-called Data-Centre I have my rack with my core stuff ( 3 system running TrueNAS (16 bay, 10 Bay and 8 bay), 2 systems running Proxmox. Just recently upgraded to a 27U server rack from an 18U unit. The UPSes are finally off the floor and on a shelf in the rack. Currently I have one UPS connected to my Main NAS and the other UPS connected to my main Proxmox system. The other systems then talk to the system that host the UPS. Will setup a RasPi 4 2GB to run NUT to be the server for the 2 UPSes. WIll have to get the Windows NUT client as I have 2 PCs on another shared UPS.
Thank you so much for the video and comprehensive walkthrough Tim! I am currently working on a project to bring in multiple UPS’ information for reference in HomeAssistant and this worked perfectly.
Hi Tim, I finally got everything setup.... AND.... IT WORKS!!! (not bad for a 65 year old network engineer😁). The 9U rack is finished and the Tripp Lite 1500VA SmartUPS, Night Hawk C2000 (2.5 Gb ports), Mini Appliance running PFsense 2.6 (4x 2.5 GB ports) and the Raspberry PI 4.0 have moved in. If interested I could post some pics. Honestly, it was so easy. The only problem I found was that after rebooting the Raspberry PI I need to reinitialize the NUT and Apache server per script. It's no big deal, because I'm running other scripts, so one more doesn't brake the bank. Ideas, comments welcome. How do you make a cashew laugh? You crack him up Why did the nut work at the bank? To cashew your check. What do you call a pair of nuts on the wall? Walnuts!
THAAANK YOUUU! This was so much harder than you made it look for my slightly more complicated setup, but I came back and used the website cgi-stats setup in this video and was just so happy that it just worked easily! I really wish you would've given a tiny bit more of a rundown of what each .conf file is used for and what each service does as I had to do a lot of reading to troubleshoot little misunderstandings I had, but I am still so happy to have a guru's quick walkthrough. "Quick" ha! If this video was over 50 minutes, I think it would have been a lot more intimidating to click on, though. I dunno.
@@JeremiahRamirezI used to drive a screw into the speaker or fill it with silicone. but I used linux ups command to shut it off. "uspc ups beeper.disable" or something like that, some of the newer ones have settings on the front panel to shut it down and be quiet while doing it.
Would be awesome if you could also cover on how to make it send emails with these notifications. And maybe how to make it shutdown when there is 5 minutes of battery left. Awesome guide nevertheless!
Thanks Tim for making this video! This is the best guide I've found for getting all this set up! I'm wondering if there is a line missing from the upssched.conf file. How does the shutdowncritical case in 'upssched-cmd' get called? Should there be a 'AT LOWBATT * EXECUTE shutdowncritical' or is it called some other way?
I suggest instead of copying the file, then clearing it out, just mv it to the new name, then nano , saves a step as nano will just create a new file if it's not there allready. Also, instead if going sudo nano you should get in the habit of using sudoedit, it does the same thing, but is more secure and less prone to data loss (if you google the command you will get posts all over the place why you want to use this instead of sudo nano).
Thanks for the video Tim. I've been wanting to do something similar using a PI as the server ever since Synology screwed up their UPS server which I had been using to shutdown my Proxmox hosts. Will now give it a go next week :)
Hello Tim, big fan of your videos. You could improve on the stats, by polling data from the UPS's every 60sec on the RPi and present them via gnuplot (this will show history of load, Vin, Vout, etc). Also, for anyone interested, please be aware that QNap NAS configured as a "client" will require specific username and password to be set up on the "server", hehe :)
hi. Did you know how to configure nut server for a ups socomec via network for home assistant? i have search all videos on youtube. all are for usb ups.
@@emilghiorghiu9994there is a Network UPS Tools (NUT) integration in home assistant. Add it and enter the credentials you set up on your nut server to connect. Replace local host with the local ip of your nut server.
Great video. Was trying to figure out how to run a windows pc, synology nas and qnap nas off a single ups and shut them all down when power goes out. Still got some figuring out tondo but this gives a great start. Thanks!!!
Definitely going to be coming back to this soon as I can get ahold of some UPS equipment. Probably will end up with something not to different from your configuration.
Nice tutorial, one thing I am missing now is the part II. - how to turn back stuff on. I assume that there is a way to use WOL to turn devices back on when the UPS status changes to online. P.S.> PLEASE, make the next video without the looping background music. 🤔
Thank you. This was very clear and helpful and I was able to get the monitor setup quickly... and even better Home Assistant automatically the NUT server and it's monitors.
Thanks for this video. I finally got another UPS for my homelab and feel it's time to actually set things up properly. I'm going to use a Raspberry Pi with OpenSUSE MicroOS installed. You should really check out MicroOS btw, perfect for this type of thing. It uses an immutable fs, atomic updates, automatic updates, automatic reboots with rebootmgrctl, and heal-checker that will automatically rollback a bad update based on whatever shell script you give it (check the nut server service is not failed for this example). It really becomes a set it up once and then forget about edge device.
@Techno Tim You forgot to mention, at 41:42 that your upssched-cmd must be executable. - chmod +x upssched-cmd - Otherwise the shutdown of the client will not work.
I use APCUPSD and the Webmin module for this. It might be a bit dated, but both still do the job. Webmin runs on my PVE box, and I use a "For" loop shell script (triggered by thresholds in APCUPSD) to do a graceful shutdown of Guest's, then the Host.
I'm also using APCUPSD; I was under the impression that PVE shuts down the VMs before it shuts down. I'd love a way to shutdown some VMs prior to others based on thresholds! Care to share your script? :-)
For clearing text files you can use vi (use keyboard shortcuts): g, g # go on top d , shift + g #delete from position to end :, x # save file and close
This definitely earned a like & subscribe. Thanks for the info. I've wanted to do a very similar setup with my homelab, and played around with NUT a little bit on a single machine, but it's great to know that I can use one machine connected to the UPS and safely shut down the other ones. I've been running a VM of Pfsense (along with many other services) in one of my 2U Supermicro boxes, and limits battery run time. I plan on moving Pfsense to a much lighter weight machine and use NUT to shut down the 2U servers and keep Pfsense up and running for a lot longer time span. Also, the 2U servers are both running Unraid and there is a NUT plugin available. I'm hoping to use the plugin and not have create / modify my own config files. Thanks again for the info.
I'm also setting up a rack (9U) with basically the very same setup using a Raspberry Pi 4 B as the server. I was also wondering how to setup the Tripp Lite Smart1500LCD 1500VA Smart UPS using the Raspberry Pi. Now I know 😊 and thanks a bunch!
Awesome video my friend, and very timely, as i am having issues with my UPS and graceful shutdown of my pfsense appliance, my UniFi,switches and Cloud Key controller. I still have loads to learn , but what you have given us, is a fantastic start. Should you have any more information on the set up the equipment above mention, please feel free to reach out. Thanks again and thanks to Tom Lawrence to point out this video.
Hi Tim. As usual, another amazing video. Learned a lot and followed all the steps in your guide to configure my new UPS. By the way, how about configuring WOL to awake the PC/Servers/others when the power goes back on?
Thank you for this tutorial. One very important thing. You might get stuck and get error: "Unable to use old-style MONITOR line without a username" if you do, check the password and remove symbol "#" :D I stuck for a long time on this "bug" :)
I couldn't think of any good NUT jokes during the video, so post them here. Cashew later!
idk, mine busted
...sorry children.
@@DaveSomething that escalated quickly!
@@TechnoTim I get a little squirrely at times
I just got an APC 3000VA last week for my rack, so I NUTted when I saw this video drop.
Thanks for a great and thorough video Tim. I was trying to do this for my home network because I have more devices than UPS units. Like some others have commented here, I too wanted to protect a pfsense firewall and some Synology NASes. I'm happy to report this worked like a champ! For the benefit of others I thought I would add a couple of things that worked for me to get those two things working.
1. PFSense: install the NUT application. Then under Services/UPS/Settings, select 'Remote NUT Server' from the dropdown and enter your IP address, user name and PW that you defined on the NUT server in Tim's video.
2. Synology: I read elswhere that Synology expects the UPS to be named 'ups' so that's what I did in the conf files that Tim walks us through in the video. Don't name it anything else and I kept it lowercase. Then on the Synology, go to Control Panel/Hardware & Power/UPS and select 'enable UPS Support' , choose 'Synology UPS Server' and enter the IP in the field that asks for it. No user name or PW is required here.
Hope this helps others!
Excellent tutorial. Two things of note when it came to my installation. On the client (Ubuntu in my case) the CMDSCRIPT is generated in /usr/bin/upssched-cmd and should be edited from there. So sudo nano /usr/bin/upssched-cmd. Next in your example there is not command to stop the earlyshutdown timer if power comes back on. So I added AT ONLINE * CANCEL-TIMER earlyshutdown to the upssched.conf. All working well after that.
thanks for mentioning, without this bit the configuration showed basically shutdowns your system down on any power event even if the power returns immediately
Thanks! Just what i needed
This worked for me! Thanks so much.
This was the solution for my immediate shutdown if power flashed. Thanks
This was actually something I was really curious about. Safely shut down servers and Nas servers to prevent corruption, separate modem / router so they last longer on battery backup. This explains how it can be done. Thanks!
Nice! That’s exactly what I am going after with this!
Thanks for another great video. In case anyone is trying to set up a CyberPower UPS, I was having an issue with disconnects and stale data. The fix was to change the setting pollinterval = 15 in the /etc/nut/ups.conf file. My particular model is CP1500PFCLCDa.
I said that before I will say it again, you rock! One of the best channels for us homelabers, of any level.
Meticulously crisp and clean explanations, I can only imagine how much effort and sweat goes into production of this. And I want to sincerely thank you for this. It really shows how much you love you put in what you do.
Also I have been trying to set up NUT tools on an RPI before and gave up because it kept breaking. My stupid fix was to setup a systemd timer task to restart the docker container in which NUT server ran every 5 minutes lmao. Will definitely give that UDEV rule a try.
Thank you so much for the kind message, and for noticing. A lot of time does go into each video for sure! Hope it works out for you!
Love your videos! I built two Proxmox boxes with old hardware just lying around thanks to your tutorials and have consolidated 5-6 NUCs into one machine, and another running PBS. I've also been using NUT servers for my two CP1500EPFCLCD units for a few weeks now. on my Proxmox machine It was pretty complex to set up, but the results were very rewarding. It runs a script to SSH into my main Windows machine and shuts down any GPU intensive processes so the battery lasts longer, and shuts it down safely once battery hits a certain threshold. Invaluable stuff, and thanks for all the amazing content for this very addictive and very dangerous (for my wallet) hobby! :D
Thank you! That sounds really awesome, looks like you took it to the next level. Love it
That gives me an idea. I participate in the folding@home project and having my PC running off my ups would drain it faster if it was just folding. I wonder how you got it to work like that and I wonder if I can take it farther by saving and closing apps that are not critical, changing power plan to use as little power as possible, and what not. I just don't know how at the moment.
To delete the contents of a file with nano, press cntrl + t then cntrl + v. Just looked this up and its a major time saver. I also create a directory called `examples` and move all the files I plan on modifying. Saves a few keystrokes. Thanks for the great content! You make homelabbing more enjoyable!
This was great. And very well done. Unlike many long tutorials on YT, this one was very easy to follow along. I have brought up 2 NUT servers so far, monitoring 7 devices, and plan to bring up a couple more. Thank you SO much for your time and for sharing this.
wow Techno Tim is seriously covering all grounds regarding Home Server.. Wonderful
cant buy raspberry pi's so I bought a libre computer renegade (rpi 3b clone) and followed this guide and it worked great THANKS TIM!!!!!!!!!
The whole nut-server, nut-client, etc took me an entire day to fully grasp. This video helped me get the bigger picture and clarify things.
A couple things to note on the upsmon configuration: The number for the UPS is the support value. This is usually 1 for UPSs that supply power to this device and 0 otherwise. This works with the MINSUPPLIES value. If you have two separate power supplies, each fed from a separate UPS (and you don't need both supplies to support this device), each of the UPSs will have the 1.
I was monitoring a UPS for my network stack from a server (router) fed from a UPS that does not have monitoring (actually a 12 VDC battery). I figured out what was happening when the UPS shut down, and the router shut down shortly after (when DEADTIME expired). And since the shutdown was commanded, it did not power back up automatically when the power came back.
I need to configure something like what you have, but I will also feed some of the metrics to Grafana.
I haven't even watched this yet, but I'm already pumped!! I've been waiting for a really good tutorial / guide on NUT. Thanks so much for doing this!
something to mention about this config which i had to changed a few things, i have configured Host 1 and Host 2 in a cluster to power down after 3 mins but i simulated a Powercut for around 30 seconds however the timer does not stop and the timer will carry on with the shutdown process regardless of Power online. Not sure how much testing you have done but this is what I found, The config which fixed this is,
CMDSCRIPT /etc/ups/upssched-cmd
PIPEFN /etc/ups/upssched.pipe
LOCKFN /etc/ups/upssched.lock
# Once any UPS goes on battery, delay turning off the beeper by 5 seconds
AT ONBATT * START-TIMER beeperoff 5
# Once any UPS goes on battery, delay executing "earlyshutdown" with 120 seconds
AT ONBATT * START-TIMER earlyshutdown 120
# If any UPS comes back cancel the "earlyshutdown" if not yet fired
AT ONLINE * CANCEL-TIMER earlyshutdown
# If battery is critical shutdown immediately
AT LOWBATT * EXECUTE shutdowncritical
I got a smoking deal on an older revision of that exact Tripp Lite 1500 (no LCD screen) and was having the worst time trying to get it to play nice with the NUT utility in pfsense and was gettign no where following text guides. 24 minutes of your video later and it works perfectly. Thanks for such a great guide!
The best walkthrough on how to setup nut server and clients. I set up a UPS (with a raspberry pi), three Proxmox hosts and an OMV NAS on first attempt. Much appreciated!
Huge Follower of your work over the years, but this video for me and the detailed data and explanation to adding a UPS to NUT and a webUI and local host was one of the best. What an amazing Video. I was following everything you did, but with a Cyberpower unit. Was able to integrate into HA with no issues - then later added the WebUI to Heimdall as well for fast access.
Thanks again Tim
Thanks a ton for this. I'm setting up monitoring of my dad's solar power system on a UPS, and I never have time to spend on it when I'm there, and I know this isn't the right way to set up a long-term system... But I'd followed a couple writeups and kept having errors, and figured I'd have to find time to fully read the documentation and start over. Finally having a few min to relax and started looking for docs, and found this video. It's running exactly as it should now. I added the NUT-UPS node in NodeRed, and I can check his power or get outage alerts at my house, 2 states away.
Thanks for the good work.
I wish you brought up how clients will start again after power is back. For me this critical as I don't always have physical access to my labs.
Other than that, great video! You bring up so much useful info in a very approachable matter without dragging it too long. Recent subscriber and binge watcher here
This is something you set in the BIOS, you would have to have the option of power-on when power is restored or have Wake-On LAN enabled in the BIOS as well
I’ve had this question for some time, especially for when I’m travelling.
Even though my BIOS is set to power on whenever power is switched in, it does not cover a scenario when the line power returns before the UPS battery is fully depleted. This probably means that the power to the board was never cut.
Or is there a way to switch off all output from the UPS and force a power cycle to leverage the BIOS feature?
I’ve always pronounced dmesg as “D message” since it displays messages from the kernel.
Also great video! I have a couple UPS’s at home in a similar setup as you, split to handle different sets of gear, and only did a little messing around with NUT to view some info from one of them, but never finished really properly setting it up. This was all great info and gave me the kick to go and finish actually setting it all up. Thanks!
Thank you!
I have NUT server running on my Unraid server with a Cyber Power UPS connected via USB. NUT server is started, recognizes the UPS and displays its status just fine in Unraid.
I have the WinNUT client running on a windows box but I could not get it to connect to the NUT server. I was banging my head on the table for about a week until I came across this video...
I had the polling interval setting in WinNUT set to 0 which is the default. Once I changed it to something other than zero it connected and the UPS status populated just fine (duh moment). The lower the number, the more "chatty" it is on the network. I believe the setting is called "Delay" on older versions of WinNut. As far as I can tell from Wireshark the NUT server doesn't broadcast, it just listens on port 3493 and responds to queries from NUT clients on the network. Glad it was something super simple.
This is exactly what I needed!!! Same setup as you, with the same use case so this is just awesome! Great tutorial. Loved the long format since it gave us more details which your other videos always has me digging online and through documentation. I'm a programmer! I am tired of looking through documentation from work. I don't need it on my free time too. Sorry just a little rant... Awesome work!
Glad it was helpful!
To get a clean configuration file, just run "mv file.conf file.example.conf" and then "nano file.conf"
This will rename the original file and let you create a clean file. You might want to verify permissions attributes though...
Been doing some big changes to my home network. Just used this tutorial to setup NUT on a Pi4, with an Eaton 5S UPS. Then configured my QNAP NAS as a slave (that was a little detour from your all NUT server client setup, it has hard coded users and password that I couldn't find to change but some other sites gave the low-down.)
Also setup WinNUT on the Windows 10 workstation (also gaming and plex server machine)
Whilst I was at it I setup gravity sync (docker containers for pihole on the QNAP as master the Pi4 and secondary.
Thanks for your awesome channel.
Nice work!!
One thing that you could improve is to explain the difference between server and client (I hope I didn't miss it.) Server is the one c9mputer, which is connected directly to the ups ising USB port, and clients are using UPS but are not connected to the UPS directly via USB or serial ports like other physical servers, virtual boxes. Again, excellent, very detailed instructional video. Thanls.
After watching this I was able to setup my Synology NAS as a NUT server to auto shut down my Linux box and Win 10 machine. Obviously made a lot of tweaks, but I learned a lot about setting up the config files. Thanks!
Nice work!
Just randomly wound up here, but this is pretty dang sweet! Who would have thought Johnny Depp was a UPS expert?
Took the whole evening but managed to set everything up! Thanks for the great tutorial ✌🏻
One of the best tutorials I have ever watched. I mentioned about you on my channel. Additionally you can run the home assistant in a container through the docker compose and add NUT panel there.
this is an immaculate walk-through. Thanks for putting this video together and sharing. Much appreciated.
Thank you so much Tim. I was going NUT trying to figure out how to get this to work.. But as sent from the sky, you just explained it in the best way. Keep up the good work.
Thank you! Happy to help!
Thank you so much for this! I have spent so many countless hours of frustration trying to configure NUT in my homelab. I had mostly given up trying to make it work how I wanted.
Excellent video, loved it!
One thing I do differently for servers is have the server automatically power on once the power has returned. That is the purpose of the powerdown flag file. To do this type of setup you need to change a setting in the bios so that power to the server will cause it to automatically turn on and you need to send the fsd command to the ups during the shutdown routine so that you ensure the file system is ready to poweroff.
I will get more info if anyone is interested. It was setup a while ago so I need to review the config files.
I've got a couple of Dell servers and wouldn't mind setting this so that they come back up once power is restored. I'll have to poke around in the BIOS.
Was pulling my hair out trying to get my Proxmox server to shutdown as a NUT client. Followed your instructions and worked straight away! Like you I cheered when I got it working lol 👍
Awesome! Great feeling isn't it! Wooo hoo!
Thanks -- great guide and very clear!! I'm neither a network nor a linux guy, but managed to get things up and running, modify the firewall in my UDM Pro to allow cross-VLAN communication for just the one RPi to the other RPi and feed the data to my Home Assistant installation. Brilliant!! I'm surprised that it work, and gratified that it did!! Now I'll go on and look at the rest of your stuff....
Thanks for you tutorial. I watched three times and spend 12hrs, and finally have my NUT server VM up and running. My pfsense VM and 2x Synology DSMs (running surveillance station) successfully connect to the server! :D
Nice work! It’s tough, that’s why I created this guide!
This is the best NUT setup guide available anywhere !
Thanks for the great informative video, I've been trying and giving up on NUT for three years. after watching your video and going back to the video a few times I have NUT integrated into Home Assistant monitoring my media/home assistant PC UPS and have a Pi Zero running Debian running NUT for my desktop's UPS.
Frickin awesome!! No half-baked standalone configuration, and even this esoteric Tripp lite catch😲 Kudos!!!
I really appreciated this video. I just found out about NUT and this helped me set it up on my Synology and add a Windows 10 client. Happy i don't have to rush to shut down my NAS now during a power outage.
Thanks for a really great video! I didn't need to setup a NUT server, since I am using the built-in 'UPS Server' that came on my QNAP NAS devices. The QNAP is easy to set up, has several more security-focused settings, and it integrates flawlessly with NUT Clients like my pfSense appliance. The part I needed the most was towards the end of the video that talks about setting up the NUT Clients. I have several servers running Red Hat, and found where NUT puts the files on a RHEL machine differed from your video... so I had to hunt the files down. I'm still not there yet with setup and testing, but your video helped me A LOT, and got me pointed in the right direction. For that; I thank you.
Thats material I was looking for :) I like there is no stupid talking, but you move with the topic forward really well :)
Great tutorial. I was not only able to configure NUT on my SuperMicro server but also able to set up my Netgear ReadyNAS's with UPS monitoring. Next I'll get it going on my Plex server and will be fully protected. Many thanks.
I was trying to figure out something similar to this 6 months ago. I gave up since I couldn't get it to work. I may give it another go with this guide since this covers some things I was unaware of. You sir got yourself a sub!
Just followed your instructions and voila... my UPS is up and running perfectly. Thanks!
Thanks for the demo and info, I have 3 CyberPower UPS and got it all setup, thanks to the info and guide. Have a great day
This is the first video I've seen of yours and now I have to go through all your videos to find that wall mount plating.
As I begin to appreciate ASL, I appreciate how you seamlessly incorporated ASL in your outros. That aside, can't wait to try this with my APCs!
Thank you!
Hey Tim,
Thanks for the video. Due to the weather, we had a few blackout of a few hours in the last month. All my device survived the abrupt power-off when the UPS run's out for years. Well, there are always exceptions and one VM in particular, my Active Directory by the way :) started to act bizarre. And then, I discovered other VM's in a similar fashion. I ended-up rebuilding the whole host server. No data loss but a waste of time to rebuild. As for the AD, a snapshot save the day. So, I started looking for solutions. Since I don't have thousands of dollars to spend on UPS's, (all of mine are similar to your), yes, they are USB ;). I needed something fairly cheap, even if I needed to roll-up my sleeves :D
I came across your channels and in particular, this video. Thanks a TON, my setup, at a high level is the following:
I run a few servers, switches, NAS, SAS, etc. in my main lab room. Some equipments have dual power supply so I've got two APC UPS's (with external battery) on their dedicated circuit. I also have two other UPS in two separate rooms. I will have these reached-out the main nut server via USB over ethernet cable device later n the week (to be tested). My nut server will be in the main room of course. Four UPS's in total to monitor.
I run VMware, Proxmox, QNAP, TrueNAS (with a EMC SAS), and a bunch of networking gear for the company I work for.
So, I'm basically running a config like the one you uses. I will be looking to shutdown machine that doesn't support the nut-client (through ssh) in the next days (seeks), as time permit.
Keep-up the good work ;)
Cheers!
By the way, I'm receiving similar message from your TripLite on the nut server from my APC UPS's (UPS lab-right@localhost is unavailable)...
Thank you million times Tim! I'm not so into linux stuff, but thanks to your guide I managed to configure my UPS with my home NAS server.
First of all thanks for this video: it was so useful for my proxmox + notebook configuration.
Anyway, I have to notice that user definition is a bit different from what reported in documentation.
In upsd.users we have to setup at least one user for administration, and you cannot find anything about in domentation: you obtain this with the "admin" specification, like you should do for "upsmon".
Moreover, documentation speaks about primary and secondary, but for real you must use master and slave.
Regards.
YESSS. I've been running apcupsd, and a grafana dashboard, but I've been having a hard time finding the motivation to dive into getting things to gracefully shut down.
You got this!
Far in to the future, this video helped another nut set up NUT. Thanks! I got this working with the Home Assistant NUT integration.
Added to my UBUNTU server, works great.
Next, I will try it with Home Assistant.
Thanks for this awesome tutorial.
Thanks. After been using NUT for a bit of time in very basic ways, figured I should look for some videos to do a better and proper setup. I have computer in a few places and also several UPSes in a few places. In my so-called Data-Centre I have my rack with my core stuff ( 3 system running TrueNAS (16 bay, 10 Bay and 8 bay), 2 systems running Proxmox. Just recently upgraded to a 27U server rack from an 18U unit. The UPSes are finally off the floor and on a shelf in the rack. Currently I have one UPS connected to my Main NAS and the other UPS connected to my main Proxmox system. The other systems then talk to the system that host the UPS. Will setup a RasPi 4 2GB to run NUT to be the server for the 2 UPSes. WIll have to get the Windows NUT client as I have 2 PCs on another shared UPS.
Great video. I dived into nut server a while ago, got it somewhat working, but gave up into expanding the config. This will help me a lot....Thank You
Just wanted to say thank you. This was an excellent tutorial and saved me a ton of time. Love your channel, keep up the good work!
Thank you so much for the video and comprehensive walkthrough Tim! I am currently working on a project to bring in multiple UPS’ information for reference in HomeAssistant and this worked perfectly.
Hi Tim, I finally got everything setup.... AND.... IT WORKS!!! (not bad for a 65 year old network engineer😁). The 9U rack is finished and the Tripp Lite 1500VA SmartUPS, Night Hawk C2000 (2.5 Gb ports), Mini Appliance running PFsense 2.6 (4x 2.5 GB ports) and the Raspberry PI 4.0 have moved in. If interested I could post some pics. Honestly, it was so easy. The only problem I found was that after rebooting the Raspberry PI I need to reinitialize the NUT and Apache server per script. It's no big deal, because I'm running other scripts, so one more doesn't brake the bank. Ideas, comments welcome.
How do you make a cashew laugh? You crack him up
Why did the nut work at the bank? To cashew your check.
What do you call a pair of nuts on the wall? Walnuts!
Nice work!!!
Also! Great jokes!!!! 🤣🤣
THAAANK YOUUU! This was so much harder than you made it look for my slightly more complicated setup, but I came back and used the website cgi-stats setup in this video and was just so happy that it just worked easily!
I really wish you would've given a tiny bit more of a rundown of what each .conf file is used for and what each service does as I had to do a lot of reading to troubleshoot little misunderstandings I had, but I am still so happy to have a guru's quick walkthrough. "Quick" ha! If this video was over 50 minutes, I think it would have been a lot more intimidating to click on, though. I dunno.
I turned off that annoying BEEP BEEP BEEP! thing, I know the power's out, I don't need to be reminded.
ok, How did you disable BEEP, PLEASE... Drives me crazy
Especially in the middle of the night. Just shut up and shutdown the NAS! )))
@@JeremiahRamirezI used to drive a screw into the speaker or fill it with silicone. but I used linux ups command to shut it off. "uspc ups beeper.disable" or something like that, some of the newer ones have settings on the front panel to shut it down and be quiet while doing it.
Would be awesome if you could also cover on how to make it send emails with these notifications. And maybe how to make it shutdown when there is 5 minutes of battery left. Awesome guide nevertheless!
Tim, love your channel. I learn something new with every video. As my server build advances, I will try Nut!
Thank you!
Thanks for this video, I've had UPSs for my homelab for a long time now but never bothered to setup nut.
Glad to help
Thanks Tim for making this video! This is the best guide I've found for getting all this set up! I'm wondering if there is a line missing from the upssched.conf file. How does the shutdowncritical case in 'upssched-cmd' get called? Should there be a 'AT LOWBATT * EXECUTE shutdowncritical' or is it called some other way?
I suggest instead of copying the file, then clearing it out, just mv it to the new name, then nano , saves a step as nano will just create a new file if it's not there allready.
Also, instead if going sudo nano you should get in the habit of using sudoedit, it does the same thing, but is more secure and less prone to data loss (if you google the command you will get posts all over the place why you want to use this instead of sudo nano).
Thanks!
Thanks for the video Tim. I've been wanting to do something similar using a PI as the server ever since Synology screwed up their UPS server which I had been using to shutdown my Proxmox hosts. Will now give it a go next week :)
Hey Tim! Excellent video, I haven't seen you around much, hope your well my friend
Fare to little coverage on this subject. Luckily you covered it fully in a single video, thx
Thank you!
Hello Tim, big fan of your videos. You could improve on the stats, by polling data from the UPS's every 60sec on the RPi and present them via gnuplot (this will show history of load, Vin, Vout, etc). Also, for anyone interested, please be aware that QNap NAS configured as a "client" will require specific username and password to be set up on the "server", hehe :)
hi. Did you know how to configure nut server for a ups socomec via network for home assistant? i have search all videos on youtube. all are for usb ups.
@@emilghiorghiu9994there is a Network UPS Tools (NUT) integration in home assistant.
Add it and enter the credentials you set up on your nut server to connect. Replace local host with the local ip of your nut server.
Tim, you're the bomb, this was super helpful and easy to follow along with.
Great video. Was trying to figure out how to run a windows pc, synology nas and qnap nas off a single ups and shut them all down when power goes out. Still got some figuring out tondo but this gives a great start. Thanks!!!
Thanks this was so detailed was able to get 4 batteries working following the first 50% of this video.
Thanks for this! Had a Pi 3B+ and a PiJuice HAT (small ups for Pi's) laying around with nothing to do and this worked out great.
Glad it helped!
Great guide!
To save time in the future when editing all those config files, here are some handy keyboard shortcuts for nano:
ALT + \
Definitely going to be coming back to this soon as I can get ahold of some UPS equipment. Probably will end up with something not to different from your configuration.
Awesome tutorial as always @technotim! Its great to get the real life happiness of a successful configuration. Makes me wanna tinker 😁
Happy to help! Thank you!
Nice tutorial, one thing I am missing now is the part II. - how to turn back stuff on.
I assume that there is a way to use WOL to turn devices back on when the UPS status changes to online.
P.S.> PLEASE, make the next video without the looping background music. 🤔
Great guide man! Thanks for putting it together!
Perfect timing - I just got my APC AP9617 Network Card working again last week. Another great project to add to my To-do list :^)
Another thing I've been meaning to do! Thanks for the tutorial!
Any time!
Thank you. This was very clear and helpful and I was able to get the monitor setup quickly... and even better Home Assistant automatically the NUT server and it's monitors.
Thanks for this video. I finally got another UPS for my homelab and feel it's time to actually set things up properly. I'm going to use a Raspberry Pi with OpenSUSE MicroOS installed. You should really check out MicroOS btw, perfect for this type of thing. It uses an immutable fs, atomic updates, automatic updates, automatic reboots with rebootmgrctl, and heal-checker that will automatically rollback a bad update based on whatever shell script you give it (check the nut server service is not failed for this example). It really becomes a set it up once and then forget about edge device.
Sounds awesome!
Thanks! I'm just getting around to do this. Better late than too late.
@Techno Tim You forgot to mention, at 41:42 that your upssched-cmd must be executable. - chmod +x upssched-cmd - Otherwise the shutdown of the client will not work.
Thank you!
I use APCUPSD and the Webmin module for this. It might be a bit dated, but both still do the job. Webmin runs on my PVE box, and I use a "For" loop shell script (triggered by thresholds in APCUPSD) to do a graceful shutdown of Guest's, then the Host.
I'm also using APCUPSD; I was under the impression that PVE shuts down the VMs before it shuts down. I'd love a way to shutdown some VMs prior to others based on thresholds! Care to share your script? :-)
For clearing text files you can use vi (use keyboard shortcuts):
g, g # go on top
d , shift + g #delete from position to end
:, x # save file and close
Please consider making an updated and simplified version of this video for users who want to monitor one UPS via Home Assistant.
This definitely earned a like & subscribe. Thanks for the info. I've wanted to do a very similar setup with my homelab, and played around with NUT a little bit on a single machine, but it's great to know that I can use one machine connected to the UPS and safely shut down the other ones.
I've been running a VM of Pfsense (along with many other services) in one of my 2U Supermicro boxes, and limits battery run time. I plan on moving Pfsense to a much lighter weight machine and use NUT to shut down the 2U servers and keep Pfsense up and running for a lot longer time span. Also, the 2U servers are both running Unraid and there is a NUT plugin available. I'm hoping to use the plugin and not have create / modify my own config files.
Thanks again for the info.
Thank you!
Thanks for this, I was struggling getting this set up myself.
I'm also setting up a rack (9U) with basically the very same setup using a Raspberry Pi 4 B as the server. I was also wondering how to setup the Tripp Lite Smart1500LCD 1500VA Smart UPS using the Raspberry Pi. Now I know 😊 and thanks a bunch!
in nano
To highlight everything: CTRL+SHIFT+END
To remove all highlighted stuff : CTRL + K
Hello, thank you for very nice how to. Works as charm for my KVM and physical machines.
Красавчик. Я наконец-то починил nut-cgi.
Awesome video my friend, and very timely, as i am having issues with my UPS and graceful shutdown of my pfsense appliance, my UniFi,switches and Cloud Key controller. I still have loads to learn , but what you have given us, is a fantastic start. Should you have any more information on the set up the equipment above mention, please feel free to reach out. Thanks again and thanks to Tom Lawrence to point out this video.
Hi Tim.
As usual, another amazing video. Learned a lot and followed all the steps in your guide to configure my new UPS.
By the way, how about configuring WOL to awake the PC/Servers/others when the power goes back on?
Tim .. your guide got me online. Thanks!!!!
Thanks for this guide!
Thank you for this tutorial. One very important thing. You might get stuck and get error: "Unable to use old-style MONITOR line without a username" if you do, check the password and remove symbol "#" :D I stuck for a long time on this "bug" :)
Thanks for sharing