Skip to content

Commit 36ff936

Browse files
authored
Add BOOST status (#30)
1 parent 256cd27 commit 36ff936

File tree

5 files changed

+41
-2
lines changed

5 files changed

+41
-2
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1818

1919
### Security
2020

21+
## [1.2.1] - 2022-08-03
22+
23+
### Added
24+
25+
- Added `BOOST` status to the `nut_ups_status` state set.
26+
2127
## [1.2.0] - 2022-07-29
2228

2329
### Added

example-data/LIST-VAR-5.txt

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
battery.charge "100"
2+
battery.runtime "2667"
3+
battery.voltage "13.60"
4+
battery.voltage.high "13.80"
5+
battery.voltage.low "10.40"
6+
battery.voltage.nominal "12.0"
7+
device.type "ups"
8+
driver.name "blazer_usb"
9+
driver.parameter.pollinterval "5"
10+
driver.parameter.port "auto"
11+
driver.parameter.runtimecal "400,100,800,50"
12+
driver.parameter.synchronous "no"
13+
driver.version "2.7.4"
14+
driver.version.internal "0.12"
15+
input.current.nominal "8.0"
16+
input.frequency "50.0"
17+
input.frequency.nominal "50"
18+
input.voltage "209.3"
19+
input.voltage.fault "209.3"
20+
input.voltage.nominal "230"
21+
output.voltage "246.9"
22+
ups.beeper.status "enabled"
23+
ups.delay.shutdown "30"
24+
ups.delay.start "180"
25+
ups.load "15"
26+
ups.productid "0000"
27+
ups.status "OL BOOST"
28+
ups.type "offline / line interactive"
29+
ups.vendorid "0001"

manage/nut-server-mock.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
UPS_EXPECTED = "alpha"
1515

1616
DATA_VER = """\
17-
Network UPS Tools upsd 2.7.4 "yolo" - http://www.networkupstools.org/
17+
Network UPS Tools upsd 2.7.4 - http://www.networkupstools.org/
1818
"""
1919
COMMAND_UPS_LIST = "list ups"
2020
DATA_UPS_LIST = """\

metrics.md

+3
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,11 @@ The `nut_ups_status` metric family describes a set of statuses, specified in the
7171
| `BYPASS` | Battery bypass |
7272
| `SD` | Shutdown |
7373
| `CP` | Cable power |
74+
| `BOOST` | Boosted voltage |
7475
| `OFF` | Off |
7576

77+
Which statuses different UPSes support varies, but `OL` (online) and `OB` (on battery) is (almost?) always supported.
78+
7679
## Miscellanea
7780

7881
To check if a specific UPS is unavailable, use something like: `absent(nut_status{job="...", ups="..."})`

src/metrics.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pub struct Metric {
2727
pub is_integer: bool,
2828
}
2929

30-
pub const UPS_STATUS_ELEMENTS: [&str; 10] = [
30+
pub const UPS_STATUS_ELEMENTS: [&str; 11] = [
3131
"OL", // online
3232
"OB", // on battery
3333
"LB", // low battery (critical)
@@ -37,6 +37,7 @@ pub const UPS_STATUS_ELEMENTS: [&str; 10] = [
3737
"BYPASS", // battery bypass
3838
"SD", // shutdown
3939
"CP", // cable power
40+
"BOOST", // boosted voltage
4041
"OFF", // off
4142
];
4243

0 commit comments

Comments
 (0)