From 62b3b2472146da7d530a2d380a1d146ca6b86f60 Mon Sep 17 00:00:00 2001
From: Alexis BITAILLOU <alexis.bitaillou@inria.fr>
Date: Mon, 31 Mar 2025 16:08:31 +0200
Subject: [PATCH] [Nantes] add scaling + add fan speed support

---
 .../sites/nantes/pdus/cooling-Z1.json         | 30 ++++++++----
 .../grid5000/sites/nantes/pdus/pdu-Z1.11.json |  5 +-
 .../grid5000/sites/nantes/pdus/pdu-Z1.21.json |  5 +-
 .../grid5000/sites/nantes/pdus/pdu-Z1.41.json |  5 +-
 .../grid5000/sites/nantes/pdus/pdu-Z1.51.json |  5 +-
 input/grid5000/sites/nantes/pdus.yaml         | 47 ++++++++++++-------
 6 files changed, 65 insertions(+), 32 deletions(-)

diff --git a/data/grid5000/sites/nantes/pdus/cooling-Z1.json b/data/grid5000/sites/nantes/pdus/cooling-Z1.json
index 182882d592a..14be4c56595 100644
--- a/data/grid5000/sites/nantes/pdus/cooling-Z1.json
+++ b/data/grid5000/sites/nantes/pdus/cooling-Z1.json
@@ -3,36 +3,50 @@
   "mac": "00:c0:b7:f5:fa:63",
   "metrics": [
     {
-      "description": "Temperature in input of cooling system, in tenths of degrees Celsius",
-      "name": "cooling_input_temperature_tenth_celsius",
+      "description": "fan speed of cooling system, in percent",
+      "name": "cooling_fan_speed_percent",
       "period": 5000,
+      "scale_factor": 0.1,
+      "source": {
+        "id": "1.3.6.1.4.1.318.1.1.27.1.4.1.2.1.3.1.5",
+        "protocol": "snmp"
+      }
+    },
+    {
+      "description": "Temperature in output of cooling system, in degrees Celsius",
+      "name": "cooling_supply_temperature_celsius",
+      "period": 5000,
+      "scale_factor": 0.1,
       "source": {
         "id": "1.3.6.1.4.1.318.1.1.27.1.4.1.2.1.3.1.7",
         "protocol": "snmp"
       }
     },
     {
-      "description": "Temperature in output of cooling system, in tenths of degrees Celsius",
-      "name": "cooling_output_temperature_tenth_celsius",
+      "description": "Temperature in input of cooling system, in degrees Celsius",
+      "name": "cooling_return_temperature_celsius",
       "period": 5000,
+      "scale_factor": 0.1,
       "source": {
         "id": "1.3.6.1.4.1.318.1.1.27.1.4.1.2.1.3.1.9",
         "protocol": "snmp"
       }
     },
     {
-      "description": "Power consumption of cooling system, in tenths of kilowatt",
-      "name": "cooling_power_watt",
+      "description": "Power consumption of cooling system, in kilowatt",
+      "name": "cooling_power_kilowatt",
       "period": 5000,
+      "scale_factor": 0.01,
       "source": {
         "id": "1.3.6.1.4.1.318.1.1.27.1.6.1.2.1.3.1.2",
         "protocol": "snmp"
       }
     },
     {
-      "description": "Sensor temperature reading, in tenths of degrees Celsius",
-      "name": "pdu_temperature_tenth_celsius",
+      "description": "Sensor temperature reading, in degrees Celsius",
+      "name": "pdu_temperature_celsius",
       "period": 5000,
+      "scale_factor": 0.1,
       "source": {
         "id": "1.3.6.1.4.1.318.1.1.27.1.4.1.2.1.3.1.%PORT%",
         "protocol": "snmp"
diff --git a/data/grid5000/sites/nantes/pdus/pdu-Z1.11.json b/data/grid5000/sites/nantes/pdus/pdu-Z1.11.json
index a9f7bc49355..15a8a7614f0 100644
--- a/data/grid5000/sites/nantes/pdus/pdu-Z1.11.json
+++ b/data/grid5000/sites/nantes/pdus/pdu-Z1.11.json
@@ -12,9 +12,10 @@
       }
     },
     {
-      "description": "Sensor temperature reading, in tenths of degrees Celsius",
-      "name": "pdu_temperature_tenth_celsius",
+      "description": "Sensor temperature reading, in degrees Celsius",
+      "name": "pdu_temperature_celsius",
       "period": 5000,
+      "scale_factor": 0.1,
       "source": {
         "id": "1.3.6.1.4.1.318.1.1.26.10.2.2.1.8.1",
         "protocol": "snmp"
diff --git a/data/grid5000/sites/nantes/pdus/pdu-Z1.21.json b/data/grid5000/sites/nantes/pdus/pdu-Z1.21.json
index a5a367549ce..89c6cc2103d 100644
--- a/data/grid5000/sites/nantes/pdus/pdu-Z1.21.json
+++ b/data/grid5000/sites/nantes/pdus/pdu-Z1.21.json
@@ -12,9 +12,10 @@
       }
     },
     {
-      "description": "Sensor temperature reading, in tenths of degrees Celsius",
-      "name": "pdu_temperature_tenth_celsius",
+      "description": "Sensor temperature reading, in degrees Celsius",
+      "name": "pdu_temperature_celsius",
       "period": 5000,
+      "scale_factor": 0.1,
       "source": {
         "id": "1.3.6.1.4.1.318.1.1.26.10.2.2.1.8.1",
         "protocol": "snmp"
diff --git a/data/grid5000/sites/nantes/pdus/pdu-Z1.41.json b/data/grid5000/sites/nantes/pdus/pdu-Z1.41.json
index 22e5d9056cc..4a908760fc1 100644
--- a/data/grid5000/sites/nantes/pdus/pdu-Z1.41.json
+++ b/data/grid5000/sites/nantes/pdus/pdu-Z1.41.json
@@ -12,9 +12,10 @@
       }
     },
     {
-      "description": "Sensor temperature reading, in tenths of degrees Celsius",
-      "name": "pdu_temperature_tenth_celsius",
+      "description": "Sensor temperature reading, in degrees Celsius",
+      "name": "pdu_temperature_celsius",
       "period": 5000,
+      "scale_factor": 0.1,
       "source": {
         "id": "1.3.6.1.4.1.318.1.1.26.10.2.2.1.8.1",
         "protocol": "snmp"
diff --git a/data/grid5000/sites/nantes/pdus/pdu-Z1.51.json b/data/grid5000/sites/nantes/pdus/pdu-Z1.51.json
index 33c0699aa61..f995db521cd 100644
--- a/data/grid5000/sites/nantes/pdus/pdu-Z1.51.json
+++ b/data/grid5000/sites/nantes/pdus/pdu-Z1.51.json
@@ -12,9 +12,10 @@
       }
     },
     {
-      "description": "Sensor temperature reading, in tenths of degrees Celsius",
-      "name": "pdu_temperature_tenth_celsius",
+      "description": "Sensor temperature reading, in degrees Celsius",
+      "name": "pdu_temperature_celsius",
       "period": 5000,
+      "scale_factor": 0.1,
       "source": {
         "id": "1.3.6.1.4.1.318.1.1.26.10.2.2.1.8.1",
         "protocol": "snmp"
diff --git a/input/grid5000/sites/nantes/pdus.yaml b/input/grid5000/sites/nantes/pdus.yaml
index 4e653d3da02..2624c7fc587 100644
--- a/input/grid5000/sites/nantes/pdus.yaml
+++ b/input/grid5000/sites/nantes/pdus.yaml
@@ -36,9 +36,10 @@ pdus:
         source:
           protocol: snmp
           id: 1.3.6.1.4.1.318.1.1.26.9.4.3.1.7.%PORT%
-      - name: pdu_temperature_tenth_celsius
-        description: Sensor temperature reading, in tenths of degrees Celsius
+      - name: pdu_temperature_celsius
+        description: Sensor temperature reading, in degrees Celsius
         period: 5000
+        scale_factor: 0.1
         source:
           protocol: snmp
           id: 1.3.6.1.4.1.318.1.1.26.10.2.2.1.8.1
@@ -95,9 +96,10 @@ pdus:
         source:
           protocol: snmp
           id: 1.3.6.1.4.1.318.1.1.26.9.4.3.1.7.%PORT%
-      - name: pdu_temperature_tenth_celsius
-        description: Sensor temperature reading, in tenths of degrees Celsius
+      - name: pdu_temperature_celsius
+        description: Sensor temperature reading, in degrees Celsius
         period: 5000
+        scale_factor: 0.1
         source:
           protocol: snmp
           id: 1.3.6.1.4.1.318.1.1.26.10.2.2.1.8.1
@@ -154,9 +156,10 @@ pdus:
         source:
           protocol: snmp
           id: 1.3.6.1.4.1.318.1.1.26.9.4.3.1.7.%PORT%
-      - name: pdu_temperature_tenth_celsius
-        description: Sensor temperature reading, in tenths of degrees Celsius
+      - name: pdu_temperature_celsius
+        description: Sensor temperature reading, in degrees Celsius
         period: 5000
+        scale_factor: 0.1
         source:
           protocol: snmp
           id: 1.3.6.1.4.1.318.1.1.26.10.2.2.1.8.1
@@ -212,9 +215,10 @@ pdus:
         source:
           protocol: snmp
           id: 1.3.6.1.4.1.318.1.1.26.9.4.3.1.7.%PORT%
-      - name: pdu_temperature_tenth_celsius
-        description: Sensor temperature reading, in tenths of degrees Celsius
+      - name: pdu_temperature_celsius
+        description: Sensor temperature reading, in degrees Celsius
         period: 5000
+        scale_factor: 0.1
         source:
           protocol: snmp
           id: 1.3.6.1.4.1.318.1.1.26.10.2.2.1.8.1
@@ -239,27 +243,38 @@ pdus:
     vendor: APC
     model: 'ACRD602'
     metrics:
-      - name: cooling_input_temperature_tenth_celsius
-        description: Temperature in input of cooling system, in tenths of degrees Celsius
+      - name: cooling_fan_speed_percent
+        description: fan speed of cooling system, in percent
         period: 5000
+        scale_factor: 0.1
+        source:
+          protocol: snmp
+          id: 1.3.6.1.4.1.318.1.1.27.1.4.1.2.1.3.1.5
+      - name: cooling_supply_temperature_celsius
+        description: Temperature in output of cooling system, in degrees Celsius
+        period: 5000
+        scale_factor: 0.1
         source:
           protocol: snmp
           id: 1.3.6.1.4.1.318.1.1.27.1.4.1.2.1.3.1.7
-      - name: cooling_output_temperature_tenth_celsius
-        description: Temperature in output of cooling system, in tenths of degrees Celsius
+      - name: cooling_return_temperature_celsius
+        description: Temperature in input of cooling system, in degrees Celsius
         period: 5000
+        scale_factor: 0.1
         source:
           protocol: snmp
           id: 1.3.6.1.4.1.318.1.1.27.1.4.1.2.1.3.1.9
-      - name: cooling_power_watt
-        description: Power consumption of cooling system, in tenths of kilowatt
+      - name: cooling_power_kilowatt
+        description: Power consumption of cooling system, in kilowatt
         period: 5000
+        scale_factor: 0.01
         source:
           protocol: snmp
           id: 1.3.6.1.4.1.318.1.1.27.1.6.1.2.1.3.1.2
-      - name: pdu_temperature_tenth_celsius
-        description: Sensor temperature reading, in tenths of degrees Celsius
+      - name: pdu_temperature_celsius
+        description: Sensor temperature reading, in degrees Celsius
         period: 5000
+        scale_factor: 0.1
         source:
           protocol: snmp
           id: 1.3.6.1.4.1.318.1.1.27.1.4.1.2.1.3.1.%PORT%
-- 
GitLab