From 6f8e5ace9babd783a9a2c6a9cf30cf2ccebbeca0 Mon Sep 17 00:00:00 2001 From: Elyes Cherfa Date: Thu, 25 Apr 2024 14:47:59 +0200 Subject: [PATCH] Issue #62: Adding Voltage conversion from MilliVolt to Volt * Added `milliVolt2Volt` conversion on `hw.voltage` and `hw.voltage.limit` values to convert values to V. --- src/main/connector/hardware/GenericUPS/GenericUPS.yaml | 6 +++--- src/main/connector/hardware/IpmiTool/IpmiTool.yaml | 6 +++--- .../LibreHardwareMonitor/LibreHardwareMonitor.yaml | 2 +- .../MIB2EntitySensor-header/MIB2EntitySensor-header.yaml | 2 +- src/main/connector/hardware/NvidiaSmi/NvidiaSmi.yaml | 2 +- .../hardware/VMwareESXi-header/VMwareESXi-header.yaml | 8 ++++---- src/main/connector/hardware/lmsensors/lmsensors.yaml | 6 +++--- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/main/connector/hardware/GenericUPS/GenericUPS.yaml b/src/main/connector/hardware/GenericUPS/GenericUPS.yaml index 25c8bdf..7f5cc44 100644 --- a/src/main/connector/hardware/GenericUPS/GenericUPS.yaml +++ b/src/main/connector/hardware/GenericUPS/GenericUPS.yaml @@ -232,8 +232,8 @@ monitors: hw.parent.type: enclosure name: "${awk::sprintf(\"%s (%s)\", $2, \"UPS\")}" metrics: - hw.voltage.limit{limit_type="high.degraded"}: $4 - hw.voltage.limit{limit_type="low.critical"}: $5 + hw.voltage.limit{limit_type="high.degraded"}: milliVolt2Volt($4) + hw.voltage.limit{limit_type="low.critical"}: milliVolt2Volt($5) collect: # Voltage Collect type: multiInstance @@ -301,7 +301,7 @@ monitors: attributes: id: $2 metrics: - hw.voltage: $3 + hw.voltage: milliVolt2Volt($3) temperature: discovery: sources: diff --git a/src/main/connector/hardware/IpmiTool/IpmiTool.yaml b/src/main/connector/hardware/IpmiTool/IpmiTool.yaml index a2dedfa..5ef2593 100644 --- a/src/main/connector/hardware/IpmiTool/IpmiTool.yaml +++ b/src/main/connector/hardware/IpmiTool/IpmiTool.yaml @@ -314,8 +314,8 @@ monitors: hw.parent.id: IPMI name: ${awk::sprintf("%s (%s)", $3, $4)} metrics: - hw.voltage.limit{limit_type="low.critical"}: $6 - hw.voltage.limit{limit_type="high.degraded"}: $7 + hw.voltage.limit{limit_type="low.critical"}: milliVolt2Volt($6) + hw.voltage.limit{limit_type="high.degraded"}: milliVolt2Volt($7) collect: # Collect type is all instances in one shot type: multiInstance @@ -339,7 +339,7 @@ monitors: attributes: id: $2 metrics: - hw.voltage: $5 + hw.voltage: milliVolt2Volt($5) power_supply: discovery: sources: diff --git a/src/main/connector/hardware/LibreHardwareMonitor/LibreHardwareMonitor.yaml b/src/main/connector/hardware/LibreHardwareMonitor/LibreHardwareMonitor.yaml index 0b45e81..07bf487 100644 --- a/src/main/connector/hardware/LibreHardwareMonitor/LibreHardwareMonitor.yaml +++ b/src/main/connector/hardware/LibreHardwareMonitor/LibreHardwareMonitor.yaml @@ -106,7 +106,7 @@ monitors: attributes: id: $1 metrics: - hw.voltage: $2 + hw.voltage: milliVolt2Volt($2) temperature: discovery: sources: diff --git a/src/main/connector/hardware/MIB2EntitySensor-header/MIB2EntitySensor-header.yaml b/src/main/connector/hardware/MIB2EntitySensor-header/MIB2EntitySensor-header.yaml index cc228f6..c5cdce0 100644 --- a/src/main/connector/hardware/MIB2EntitySensor-header/MIB2EntitySensor-header.yaml +++ b/src/main/connector/hardware/MIB2EntitySensor-header/MIB2EntitySensor-header.yaml @@ -165,7 +165,7 @@ monitors: attributes: id: $1 metrics: - hw.voltage: $4 + hw.voltage: milliVolt2Volt($4) hw.status{hw.type="voltage"}: $5 legacyTextParameters: StatusInformation: $6 diff --git a/src/main/connector/hardware/NvidiaSmi/NvidiaSmi.yaml b/src/main/connector/hardware/NvidiaSmi/NvidiaSmi.yaml index 2a14c90..f1a001e 100644 --- a/src/main/connector/hardware/NvidiaSmi/NvidiaSmi.yaml +++ b/src/main/connector/hardware/NvidiaSmi/NvidiaSmi.yaml @@ -165,7 +165,7 @@ monitors: attributes: id: $2 metrics: - hw.voltage: $3 + hw.voltage: milliVolt2Volt($3) fan: discovery: sources: diff --git a/src/main/connector/hardware/VMwareESXi-header/VMwareESXi-header.yaml b/src/main/connector/hardware/VMwareESXi-header/VMwareESXi-header.yaml index 81aa5e9..406af10 100644 --- a/src/main/connector/hardware/VMwareESXi-header/VMwareESXi-header.yaml +++ b/src/main/connector/hardware/VMwareESXi-header/VMwareESXi-header.yaml @@ -976,11 +976,11 @@ monitors: hw.parent.type: enclosure name: $2 metrics: - hw.voltage.limit{limit_type="high.degraded"}: $7 - hw.voltage.limit{limit_type="low.critical"}: $6 + hw.voltage.limit{limit_type="high.degraded"}: milliVolt2Volt($7) + hw.voltage.limit{limit_type="low.critical"}: milliVolt2Volt($6) conditionalCollection: hw.status{hw.type="voltage"}: $5 - hw.voltage: $3 + hw.voltage: milliVolt2Volt($3) collect: type: multiInstance keys: @@ -1045,7 +1045,7 @@ monitors: id: $2 metrics: hw.status{hw.type="voltage"}: $4 - hw.voltage: $3 + hw.voltage: milliVolt2Volt($3) legacyTextParameters: StatusInformation: $5 network: diff --git a/src/main/connector/hardware/lmsensors/lmsensors.yaml b/src/main/connector/hardware/lmsensors/lmsensors.yaml index d80eeba..829b69e 100644 --- a/src/main/connector/hardware/lmsensors/lmsensors.yaml +++ b/src/main/connector/hardware/lmsensors/lmsensors.yaml @@ -138,8 +138,8 @@ monitors: hw.parent.id: Computer name: ${awk::sprintf("%s (%s)", $2, "Planar")} metrics: - hw.voltage.limit{limit_type="low.critical"}: $5 - hw.voltage.limit{limit_type="high.degraded"}: $6 + hw.voltage.limit{limit_type="low.critical"}: milliVolt2Volt($5) + hw.voltage.limit{limit_type="high.degraded"}: milliVolt2Volt($6) collect: # Collection Type type: multiInstance @@ -161,7 +161,7 @@ monitors: attributes: id: $2 metrics: - hw.voltage: $4 + hw.voltage: milliVolt2Volt($4) fan: discovery: sources: