Skip to content

Commit 4098ef9

Browse files
authored
Adds amp/current support to ipmitool (prometheus-community#36)
Signed-off-by: Sung Park <[email protected]>
1 parent fc283fe commit 4098ef9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ipmitool

+8
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,15 @@ BEGIN {
3131
# Friendly description of the type of sensor for HELP.
3232
help["temperature_celsius"] = "Temperature";
3333
help["volts"] = "Voltage";
34+
help["amps"] = "Current";
3435
help["power_watts"] = "Power";
3536
help["speed_rpm"] = "Fan";
3637
help["percent"] = "Device";
3738
help["status"] = "Chassis status";
3839

3940
temperature_celsius["metric_count"] = 0;
4041
volts["metric_count"] = 0;
42+
amps["metric_count"] = 0;
4143
power_watts["metric_count"] = 0;
4244
speed_rpm["metric_count"] = 0;
4345
percent["metric_count"] = 0;
@@ -67,6 +69,11 @@ $3 ~ /Volts/ {
6769
volts["metric_count"]++;
6870
}
6971

72+
$3 ~ /Amps/ {
73+
amps[$1] = $2;
74+
amps["metric_count"]++;
75+
}
76+
7077
$3 ~ /Watts/ {
7178
power_watts[$1] = $2;
7279
power_watts["metric_count"]++;
@@ -90,6 +97,7 @@ $3 ~ /discrete/ {
9097
END {
9198
export(temperature_celsius, "temperature_celsius");
9299
export(volts, "volts");
100+
export(amps, "amps");
93101
export(power_watts, "power_watts");
94102
export(speed_rpm, "speed_rpm");
95103
export(percent, "percent");

0 commit comments

Comments
 (0)