Repository navigation
Replies: 3 comments 9 replies
|
Hi @MrQwerky, thank you for this thoughtful post and love & support as well. We do need to add some solid documentation around the options and usage of WinNUT. I guess the reasons for that not happening yet have just been other priorities as well as plans for larger changes to WinNUT that might outdate documentation anyways. But I'm always happy to answer questions and will probably learn more about how WinNUT works myself.
The information about the UPS shown on the main window is only supposed to reflect the state of the UPS and has no relation to the Shutdown options, only the Calibration tab for adjusting gauge settings. Same goes for the status indicators - NUT has a series of flags it uses to represent the state of a UPS device, so we show those in a graphical form. The shutdown conditions are only evaluated during a data update cycle in WinNUT, and only if the UPS is indicating an "on battery" status (see here if you want to browse the code for that.) When the UPS indicates it's on battery, then WinNUT updates the status indicators and goes on to check if both the battery charge and runtime variables are valid. If both are invalid, WinNUT logs an error and skips this part. But if at least one variable is valid, then it checks if a shutdown has already been initiated. If not, then WinNUT checks each variable to again make sure it's valid, then if it's below or equal to the condition set in the Shutdown menu, the shutdown process/window is launched (configured in the below options.)
I think you've got the gist of it. In addition to the condition evaluation algorithm I described above that triggers a "Shutdown_Event" as it's known in WinNUT, the shutdown procedure is actually also triggered when the UPS has indicated a Full Shut Down event as well. The Shutdown_Event process will check if the Immediate stop action is enabled, and if so, run the stop action. Otherwise, it activates the Shutdown_Gui which, while showing a nice GUI of the shutdown procedure, also doubles as the code that controls it. At this point, a timer counting the "Delay to Shutdown" option begins. If it expires, then the shutdown action from before is run. If the user enabled the Allow Extended Shutdown Time option, then they can click the button which should add the Grace Delay option to the current shutdown time.
Right, that will be the smaller window from before which shows the countdown time and offers the user a way to extend it.
Exactly, so it will follow the same process as if one of the other shutdown conditions had passed.
The NUT server was designed with this in mind: NUT has the concept of "logging in", which to it is in part authentication, but also indicating to the NUT server that this device is depending on it for power. When a Full Shut Down is triggered, or devices are following other conditions, then they log out from the NUT server to indicate that they are going down. NUT also has a capability to tell the UPS to shut off, which also has the side effect of power cycling devices like the Synologies which may be in their safe mode and waiting for a power cycle to boot back up. I've never managed to get it that sophisticated before though, and I'm not even sure if we have the capability to configure the Synology NUT software in that way, since it's the one ultimately controlling the UPS.
This is exactly how I have my client configured. I set the Shutdown if battery lower than ___ % value to about 95 or 100, so that the shutdown timer begins almost immediately once the UPS is on battery. I still give it about 10 or 15 seconds to give a chance for the power to come back on, but if not, then I want my server shutting down ASAP so this configuration works well for me. I acknowledge it could be a bit cleaner and more straightforward though, so stay tuned and please submit any ideas if you have a vision for how that'd look or work. I'm thinking I'd like some kind of generalized events system (see #92 for more discussion) so the user can configure how WinNUT responds to a variety of different conditions and parameters, with many different kinds of actions.
I want to mention here that there can be some confusion about what a low battery is. I believe there's a specific NUT UPS flag to indicate that the UPS is in some kind of low-battery state (as determined by some combination of the UPS's firmware programming, and perhaps a NUT configuration.) But WinNUT is also free to determine what a low battery is based on user input, although that doesn't affect the status indicators on the main screen which might've prompted your first question. But how you determine what a low battery is and means is an important question. I think it does depend a lot on your priorities. I personally want to take my machine (the WinNUT client) down sooner than later, so there's some battery power left over to run networking equipment. The Synology safe mode one has been difficult for me, because as far as I can tell the only way to bring it back out of safe mode is by powering the device off. This is fine and well for an extended power outage, but if the power comes back before the UPS shuts down, then the Syno can't be taken out of safe mode besides a complete power off. If you have some kind of Wake on LAN/MagicPacket client, it makes it easier to wake up devices that have shutdown so going down sooner rather than later may be ok. This does raise a need for some kind of low-powered, permanent device that go up or down without issue, and can monitor the UPS to orchestrate device power depending on conditions. |
|
Some further thoughts. What does WinNUT do should the server go down, and WinNUT loose connection. Does it initiate the shutdown sequence? One suggestion might be to provide a "lost connection" countdown timer, just like the others. Some results from my testing: Synology NAS set to enable WOL; with Synology, this also forces enabling of restart on power return. Synology NUT server set to enter safe mode after 20 seconds. WinNUT client configured to shutdown when battery level is below 100%, with delay set to five minutes to provide time for testing. Then I pulled the UPS power plug. The Synology immediately indicated "on battery". The WinNUT client also immediately indicated "on battery", and the "on-line" indicator changed from green to yellow. The client immediately initiated the shutdown sequence without waiting for the battery level to fall to 99%, thus indicating that the WinNUT client "Shutdown if battery lower than" setting is really "Shutdown if battery is lower than or equal to". The client also immediately showed the ups.status as "FSD OB DISCHRG", so the Synology asserts FSD immediately. Is this correct procedure according to NUT specifications? Next, the Synology appeared to enter safe mode, as the "STATUS" LED turned off, although the drive LEDs remained on, and the "LAN" LED continued to blink with activity. At this point, repeated queries from the client continued to indicate the same ups.status of "FSD OB DISCHRG", so I'm not sure whether the NAS NUT server was simply repeating the last condition each time it was queried, or whether it was still responding with the current condition. I did receive an e-mail from the NAS saying that all services are shut down. But in either case it was still actually responding to queries from the client machine (outside of WinNUT). Restoring power caused the NAS to initiate a reboot, and immediately caused the WinNUT client to terminate the shutdown sequence. There was no opportunity to send the NAS a WOL signal, but it did confirm that the Synology can indeed restart when power is restored, at least from safe mode; I did not let the battery drain completely so as to cause the NAS to loose power. It is interesting to me that at power loss, WinNUT showed the "on battery" indicator as green, but changed the "on-line" indicator from green to yellow, rather than either changing it to red, or simply turning it off. Does this indicate that the UPS was no longer on mains power, but that the NUT server was still on-line; and that had the NUT server gone off-line, the indicator would have changed to red, or simply turned off? This is another situation where documentation would be very helpful. |
|
Hi guys, I'm watching this with great interest as I'm a bit of a newby to NUT. I used to run APCUPSD on my Windows server which worked fine but when I changed my rather small APC to a large Liebert UPS I assumed that APCUPSD would no longer work. It turns out that actually it probably would have with some tweaking but now I'm quiet deep into learning NUT and linux. I have just tested the scenario of the NUT server (running OpenMediaVault BTW) being offline and what WinNUT Client will do. The result is that it actually locks up as it is continuously trying to re-establish connection. Whilst this is not really a problem there is a scenario where it could be. If for some reason the Linux box is offline and there is a power cut the Windows box will never shutdown. If it is a planned outage of the Linux box such as a reboot then it's up to me to manage it. If it's a system failure then it would be nice to be able to set a "lost communication timer" on WinNut client which then initiates a shutdown. If I was using NUT-Client there are apparently settings in upsmon.conf that would achieve this. Anyway I am digressing somewhat from the origional point of this conversation |
Uh oh!
There was an error while loading. Please reload this page.
First of all, many thanks for your hard work in continuing to support this project for such a period of time.
So, I've spent considerable time searching both this repo and the web in general, for information regarding proper configuration of WinNUT-Client, and what the settings actually do, without much success. Perhaps if I posed some specific questions, specifically with regard to the Shutdown Options?
Firstly, how do those options relate to the status shown on the main window? Do the shutdown options take effect even when the UPS is On-Line, or only when it is On-Battery?
When a shutdown condition occurs (low battery, low runtime), what procedure does the program follow? My best guess would be that once the condition occurs, the Delay to Shutdown time is allowed to elapse, and then if the Extended Shutdown Time is enabled, that the Grace Delay time is also allowed to elapse, and finally the program initiates a Windows shutdown (or according to the Type of Stop selection).
When such a condition triggers this procedure, does the program notify the user in any way?
What is the procedure when an FSD condition occurs (and is enabled); does it go through the same time delays as above, and also notify the user?
Finally, I would appreciate some best-practices recommendations as to configuring the WinNUT-Client and the NUT server to operate together. For example, it would seem to be imperative that the computer shut down before the server does. The server (in my case, a Synology NAS) may be configured to enter safe mode either after a specified time, or when the UPS battery level becomes low.
If set for a specified time, it must be long enough to allow the client computer to react and shut down, whether the client is configured to wait for specified low battery level, or low runtime, and including the shutdown timeouts; but not so long that the UPS is depleted before the server can enter safe mode. This configuration would be greatly helped if WinNUT-Client had an option to shut down after a specified time without regard to battery level or runtime remaining.
Or would it be better to configure the server to enter safe mode when it reaches a low battery state, and configure WinNUT-Client to shut down when the battery reaches some low level which is higher than the level targeted by the server? This is complicated by the fact that I have no idea what that target level in the server is, as it simply says "Until low battery".
Looking forward to some helpful information.
All reactions