-
-
Notifications
You must be signed in to change notification settings - Fork 398
failover.c - UPS Failover Driver #2962
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 8 commits
8dae3b5
5855e6e
fe08563
bf3b9e2
961fbc2
6b33157
e5f3631
2fac5e1
f4d8ab7
2c74214
1ad9b26
683559c
fb3d251
18ac174
be52d0b
f3b1541
53359b7
9f78e4c
022342c
a6fda90
22c8465
44cabf3
b799a9d
5321a55
953d368
12e7da4
825edd2
2c68099
95ea397
f001318
3625b15
36204e8
962bac4
505853f
784ce12
ff08659
54c604b
89a0db0
ccaac91
c498dd3
d8f171c
9a6f56c
0937f25
fb3cac7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -112,6 +112,24 @@ itself. This mode is for setups where immediate shutdown is warranted, | |
| regardless of anything else, and getting `FSD` out to the clients as fast as | ||
| just possible. | ||
|
|
||
| *checkruntime*='0|1|2|3':: | ||
| Optional. Controls how `battery.runtime` values are used to break ties between | ||
| non-fully-online UPS devices **at priority 3 or lower**. Has no effect on | ||
| initial priority selection or when `strictfiltering` is enabled. Defaults to 1. | ||
|
|
||
| - `0`: *Disabled.* No runtime comparison is done. The first candidate with the | ||
| best priority is selected according to the order of the port argument. | ||
|
|
||
| - `1`: *Compare `battery.runtime`.* The UPS with the higher value is preferred. | ||
| If the value is missing or invalid, the UPS cannot win the tie-break. | ||
|
|
||
| - `2`: *Compare `battery.runtime.low`.* The UPS with the higher value is | ||
| preferred. If the value is missing or invalid, the UPS cannot win the tie-break. | ||
|
|
||
| - `3`: *Compare both variables strictly.* The UPS is preferred only if it has | ||
| both a higher `battery.runtime` and `battery.runtime.low` value. If either is | ||
| missing or invalid, the UPS cannot win the tie-break. | ||
|
|
||
| *strictfiltering*='0|1':: Optional. If set to 1, only UPS drivers matching the | ||
| configured status filters are considered for promotion to primary. If set to 0, | ||
| the hard-coded default logic is also considered when no status filters match | ||
|
|
@@ -250,6 +268,11 @@ When using `failover` for redundancy between multiple UPS drivers connected to | |
| the same underlying UPS device, data is not multiplexed between the drivers. As | ||
| a result, some data points may be available in some drivers but not in others. | ||
|
|
||
| For `checkruntime` considerations, the unit of both `battery.runtime` and | ||
| `battery.runtime.low` is assumed to be **seconds**. UPS drivers that report | ||
| these values using different units are considered non-compliant with the NUT | ||
| variable standards and should be reported to the NUT developers as faulty. | ||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. General note for posterity: not all NUT drivers provide a For the purpose here, comparing charges is probably rather useless (unless the UPSes have similar capacity so runtimes would happen to compare similarly); but it may be productive to eventually focus on generalizing the |
||
| AUTHOR | ||
| ------ | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure how useful this one is for such comparisons, being a fixed value that may be (derived from) a user setting:
It may also be irrelevant if e.g.
upsschedis used withupsmonfor a custom shutdown strategy like "if OB took longer than 5 min to recover from" regardless of battery charge/runtime remaining.But for some users their (own or device's) setting may be a measure of UPS reliability, so why not.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I understood this as: this is the seconds left (timer) before the UPS switches to
LB. Want me to remove it?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it can stay, just needed a second glance at usefulness. This can be a factor for some shutdown scenarios - "this UPS will give me a 5-minute FSD window to shut down gracefully (because that's when it becomes OB+LB)", although for specifically shutdowns with
upsmon- more likely the "real" driver would be consulted as one of several supplies, than the failover one. But as you said, for single-UPS clients this may still be relevant.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, thanks for the double check. 👍