From a8f7e0b73e785aedbea593ec96d00e8894e7d2a8 Mon Sep 17 00:00:00 2001
From: Patrice RINGOT <patrice.ringot@loria.fr>
Date: Sun, 7 Jul 2024 23:29:52 +0200
Subject: [PATCH] [nancy] update kwollect config after first relocation to the
 DCML (grvingt/sgrvingt/grostiti/gw-next)

---
 .../nancy/clusters/grostiti/grostiti.json     | 88 +++++++++++++++++++
 .../nancy/network_equipments/gw-next.json     | 74 ++++++++++++++++
 .../sites/nancy/networks/gw-next.yaml         | 49 +++++++++++
 3 files changed, 211 insertions(+)

diff --git a/data/grid5000/sites/nancy/clusters/grostiti/grostiti.json b/data/grid5000/sites/nancy/clusters/grostiti/grostiti.json
index 0367b4098ac..00cc42cefb6 100644
--- a/data/grid5000/sites/nancy/clusters/grostiti/grostiti.json
+++ b/data/grid5000/sites/nancy/clusters/grostiti/grostiti.json
@@ -316,6 +316,94 @@
         "port": 9100,
         "protocol": "prometheus"
       }
+    },
+    {
+      "description": "Input byte counter for the network device port",
+      "labels": {
+        "interface": "eth0"
+      },
+      "name": "network_ifacein_bytes_total",
+      "period": 1000,
+      "source": {
+        "protocol": "network_equipment"
+      }
+    },
+    {
+      "description": "Output byte counter for the network device port",
+      "labels": {
+        "interface": "eth0"
+      },
+      "name": "network_ifaceout_bytes_total",
+      "period": 1000,
+      "source": {
+        "protocol": "network_equipment"
+      }
+    },
+    {
+      "description": "Input packet counter for the network device port",
+      "labels": {
+        "interface": "eth0"
+      },
+      "name": "network_ifacein_packets_total",
+      "period": 1000,
+      "source": {
+        "protocol": "network_equipment"
+      }
+    },
+    {
+      "description": "Output packet counter for the network device port",
+      "labels": {
+        "interface": "eth0"
+      },
+      "name": "network_ifaceout_packets_total",
+      "period": 1000,
+      "source": {
+        "protocol": "network_equipment"
+      }
+    },
+    {
+      "description": "Input counter of discarded packets for the network device port",
+      "labels": {
+        "interface": "eth0"
+      },
+      "name": "network_ifacein_packets_discard_total",
+      "period": 1000,
+      "source": {
+        "protocol": "network_equipment"
+      }
+    },
+    {
+      "description": "Output counter of discarded packets for the network device port",
+      "labels": {
+        "interface": "eth0"
+      },
+      "name": "network_ifaceout_packets_discard_total",
+      "period": 1000,
+      "source": {
+        "protocol": "network_equipment"
+      }
+    },
+    {
+      "description": "Input counter of packet errors for the network device port",
+      "labels": {
+        "interface": "eth0"
+      },
+      "name": "network_ifacein_packets_error_total",
+      "period": 1000,
+      "source": {
+        "protocol": "network_equipment"
+      }
+    },
+    {
+      "description": "Output counter of packet errors for the network device port",
+      "labels": {
+        "interface": "eth0"
+      },
+      "name": "network_ifaceout_packets_error_total",
+      "period": 1000,
+      "source": {
+        "protocol": "network_equipment"
+      }
     }
   ],
   "model": "Dell PowerEdge R930",
diff --git a/data/grid5000/sites/nancy/network_equipments/gw-next.json b/data/grid5000/sites/nancy/network_equipments/gw-next.json
index 29a42535d7d..fa829fa3ac5 100644
--- a/data/grid5000/sites/nancy/network_equipments/gw-next.json
+++ b/data/grid5000/sites/nancy/network_equipments/gw-next.json
@@ -141,6 +141,80 @@
     }
   ],
   "managed_by_us": true,
+  "metrics": [
+    {
+      "description": "Input byte counter for the network device port",
+      "name": "network_ifacein_bytes_total",
+      "period": 1000,
+      "source": {
+        "id": "1.3.6.1.2.1.2.2.1.10.{{ 1.3.6.1.2.1.2.2.1.2 == %SNMP_IFACE% }}",
+        "protocol": "snmp"
+      }
+    },
+    {
+      "description": "Output byte counter for the network device port",
+      "name": "network_ifaceout_bytes_total",
+      "period": 1000,
+      "source": {
+        "id": "1.3.6.1.2.1.2.2.1.16.{{ 1.3.6.1.2.1.2.2.1.2 == %SNMP_IFACE% }}",
+        "protocol": "snmp"
+      }
+    },
+    {
+      "description": "Input packet counter for the network device port",
+      "name": "network_ifacein_packets_total",
+      "period": 1000,
+      "source": {
+        "id": "1.3.6.1.2.1.2.2.1.11.{{ 1.3.6.1.2.1.2.2.1.2 == %SNMP_IFACE% }}",
+        "protocol": "snmp"
+      }
+    },
+    {
+      "description": "Output packet counter for the network device port",
+      "name": "network_ifaceout_packets_total",
+      "period": 1000,
+      "source": {
+        "id": "1.3.6.1.2.1.2.2.1.17.{{ 1.3.6.1.2.1.2.2.1.2 == %SNMP_IFACE% }}",
+        "protocol": "snmp"
+      }
+    },
+    {
+      "description": "Input counter of discarded packets for the network device port",
+      "name": "network_ifacein_packets_discard_total",
+      "period": 1000,
+      "source": {
+        "id": "1.3.6.1.2.1.2.2.1.13.{{ 1.3.6.1.2.1.2.2.1.2 == %SNMP_IFACE% }}",
+        "protocol": "snmp"
+      }
+    },
+    {
+      "description": "Output counter of discarded packets for the network device port",
+      "name": "network_ifaceout_packets_discard_total",
+      "period": 1000,
+      "source": {
+        "id": "1.3.6.1.2.1.2.2.1.19.{{ 1.3.6.1.2.1.2.2.1.2 == %SNMP_IFACE% }}",
+        "protocol": "snmp"
+      }
+    },
+    {
+      "description": "Input counter of packet errors for the network device port",
+      "name": "network_ifacein_packets_error_total",
+      "period": 1000,
+      "source": {
+        "id": "1.3.6.1.2.1.2.2.1.14.{{ 1.3.6.1.2.1.2.2.1.2 == %SNMP_IFACE% }}",
+        "protocol": "snmp"
+      }
+    },
+    {
+      "description": "Output counter of packet errors for the network device port",
+      "name": "network_ifaceout_packets_error_total",
+      "period": 1000,
+      "source": {
+        "id": "1.3.6.1.2.1.2.2.1.20.{{ 1.3.6.1.2.1.2.2.1.2 == %SNMP_IFACE% }}",
+        "protocol": "snmp"
+      }
+    }
+  ],
   "model": "Aruba 8325-48Y8C JL635A",
   "serial": "TW32KM007R",
   "site": "nancy",
diff --git a/input/grid5000/sites/nancy/networks/gw-next.yaml b/input/grid5000/sites/nancy/networks/gw-next.yaml
index bfc721a14e9..c264b2f3504 100644
--- a/input/grid5000/sites/nancy/networks/gw-next.yaml
+++ b/input/grid5000/sites/nancy/networks/gw-next.yaml
@@ -10,6 +10,55 @@ gw-next:
     - name: gw-next-adm # interface de management
       ip: 172.17.79.252
   snmp_community: public
+  metrics:
+    - name: network_ifacein_bytes_total
+      description: Input byte counter for the network device port
+      period: 1000
+      source:
+        protocol: snmp
+        id: 1.3.6.1.2.1.2.2.1.10.{{ 1.3.6.1.2.1.2.2.1.2 == %SNMP_IFACE% }}
+    - name: network_ifaceout_bytes_total
+      description: Output byte counter for the network device port
+      period: 1000
+      source:
+        protocol: snmp
+        id: 1.3.6.1.2.1.2.2.1.16.{{ 1.3.6.1.2.1.2.2.1.2 == %SNMP_IFACE% }}
+    - name: network_ifacein_packets_total
+      description: Input packet counter for the network device port
+      period: 1000
+      source:
+        protocol: snmp
+        id: 1.3.6.1.2.1.2.2.1.11.{{ 1.3.6.1.2.1.2.2.1.2 == %SNMP_IFACE% }}
+    - name: network_ifaceout_packets_total
+      description: Output packet counter for the network device port
+      period: 1000
+      source:
+        protocol: snmp
+        id: 1.3.6.1.2.1.2.2.1.17.{{ 1.3.6.1.2.1.2.2.1.2 == %SNMP_IFACE% }}
+    - name: network_ifacein_packets_discard_total
+      description: Input counter of discarded packets for the network device port
+      period: 1000
+      source:
+        protocol: snmp
+        id: 1.3.6.1.2.1.2.2.1.13.{{ 1.3.6.1.2.1.2.2.1.2 == %SNMP_IFACE% }}
+    - name: network_ifaceout_packets_discard_total
+      description: Output counter of discarded packets for the network device port
+      period: 1000
+      source:
+        protocol: snmp
+        id: 1.3.6.1.2.1.2.2.1.19.{{ 1.3.6.1.2.1.2.2.1.2 == %SNMP_IFACE% }}
+    - name: network_ifacein_packets_error_total
+      description: Input counter of packet errors for the network device port
+      period: 1000
+      source:
+        protocol: snmp
+        id: 1.3.6.1.2.1.2.2.1.14.{{ 1.3.6.1.2.1.2.2.1.2 == %SNMP_IFACE% }}
+    - name: network_ifaceout_packets_error_total
+      description: Output counter of packet errors for the network device port
+      period: 1000
+      source:
+        protocol: snmp
+        id: 1.3.6.1.2.1.2.2.1.20.{{ 1.3.6.1.2.1.2.2.1.2 == %SNMP_IFACE% }}
   backplane_bps: 1440000000000
   linecards:
     1:
-- 
GitLab