From 6d231f8187f3bc0aebb7549e01810073e69f3fc3 Mon Sep 17 00:00:00 2001
From: Ludovic Schoepps <ludovic.schoepps@uni.lu>
Date: Mon, 4 Nov 2024 15:56:28 +0100
Subject: [PATCH] [luxembourg] Fix network description (wrong port-channel and
 missing gw-kirchberg)

---
 .../network_equipments/gw-kirchberg.json      | 256 ++++++++++++++++++
 .../luxembourg/network_equipments/gw.json     |  31 +--
 .../luxembourg/network_equipments/sw-b04.json |  42 +--
 .../luxembourg/network_equipments/sw-b09.json |   4 +-
 .../network_equipments/ul-grid5000-sw02.json  |   2 +-
 .../luxembourg/networks/gw-kirchberg.yaml     | 101 +++++++
 .../luxembourg/networks/gw-luxembourg.yaml    |  29 +-
 .../sites/luxembourg/networks/sw-b04.yaml     |  24 +-
 .../sites/luxembourg/networks/sw-b09.yaml     |   4 +-
 .../luxembourg/networks/ul-grid5000-sw02.yaml |   2 +-
 10 files changed, 377 insertions(+), 118 deletions(-)
 create mode 100644 data/grid5000/sites/luxembourg/network_equipments/gw-kirchberg.json
 create mode 100644 input/grid5000/sites/luxembourg/networks/gw-kirchberg.yaml

diff --git a/data/grid5000/sites/luxembourg/network_equipments/gw-kirchberg.json b/data/grid5000/sites/luxembourg/network_equipments/gw-kirchberg.json
new file mode 100644
index 00000000000..d96fd7c026e
--- /dev/null
+++ b/data/grid5000/sites/luxembourg/network_equipments/gw-kirchberg.json
@@ -0,0 +1,256 @@
+{
+  "backplane_bps": 720000000000,
+  "channels": {
+    "Port-channel4": {
+      "kind": "switch",
+      "port": "port-channel4",
+      "rate": 20000000000,
+      "uid": "ul-grid5000-sw02"
+    }
+  },
+  "ip": "172.16.191.240",
+  "kind": "switch",
+  "linecards": [
+    {
+    },
+    {
+    },
+    {
+      "backplane_bps": 40000000000,
+      "kavlan_pattern": "Gi%LINECARD%/%PORT%",
+      "kind": "node",
+      "ports": [
+        {
+        },
+        {
+        },
+        {
+        },
+        {
+        },
+        {
+        },
+        {
+        },
+        {
+        },
+        {
+        },
+        {
+        },
+        {
+        },
+        {
+        },
+        {
+        },
+        {
+        },
+        {
+        },
+        {
+        },
+        {
+        },
+        {
+        },
+        {
+        },
+        {
+        },
+        {
+        },
+        {
+        },
+        {
+        },
+        {
+        },
+        {
+        },
+        {
+        },
+        {
+        },
+        {
+        },
+        {
+        },
+        {
+        },
+        {
+        },
+        {
+        },
+        {
+        },
+        {
+        },
+        {
+        },
+        {
+        },
+        {
+        },
+        {
+        },
+        {
+        },
+        {
+        },
+        {
+        },
+        {
+        },
+        {
+        },
+        {
+        },
+        {
+        },
+        {
+          "kind": "server",
+          "snmp_name": "GigabitEthernet2/44",
+          "uid": "cronos"
+        },
+        {
+        },
+        {
+        },
+        {
+        },
+        {
+        }
+      ],
+      "rate": 1000000000,
+      "snmp_pattern": "GigabitEthernet%LINECARD%/%PORT%"
+    },
+    {
+      "backplane_bps": 40000000000,
+      "kavlan_pattern": "Ti%LINECARD%/%PORT%",
+      "kind": "channel",
+      "ports": [
+        {
+        },
+        {
+          "kind": "channel",
+          "snmp_name": "TenGigabitEthernet3/1",
+          "uid": "Port-channel4"
+        },
+        {
+          "kind": "channel",
+          "snmp_name": "TenGigabitEthernet3/2",
+          "uid": "Port-channel4"
+        }
+      ],
+      "rate": 10000000000,
+      "snmp_pattern": "TenGigabitEthernet%LINECARD%/%PORT%"
+    },
+    {
+    },
+    {
+      "backplane_bps": 40000000000,
+      "kavlan_pattern": "Ti%LINECARD%/%PORT%",
+      "kind": "router",
+      "ports": [
+        {
+        },
+        {
+        },
+        {
+        },
+        {
+        },
+        {
+          "kind": "router",
+          "rate": 10000000000,
+          "snmp_name": "TenGigabitEthernet5/4",
+          "uid": "gw"
+        }
+      ],
+      "rate": 1000000000,
+      "snmp_pattern": "TenGigabitEthernet%LINECARD%/%PORT%"
+    }
+  ],
+  "managed_by_us": true,
+  "metrics": [
+    {
+      "description": "Input byte counter for the network device port",
+      "name": "network_ifacein_bytes_total",
+      "period": 5000,
+      "source": {
+        "id": "1.3.6.1.2.1.31.1.1.1.6.{{ 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": 5000,
+      "source": {
+        "id": "1.3.6.1.2.1.31.1.1.1.10.{{ 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": 5000,
+      "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": 5000,
+      "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": 5000,
+      "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": 5000,
+      "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": 5000,
+      "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": 5000,
+      "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": "cisco WS-C6506-E",
+  "site": "luxembourg",
+  "snmp_community": "public",
+  "type": "network_equipment",
+  "uid": "gw-kirchberg",
+  "warranty": "2018-12-01"
+}
\ No newline at end of file
diff --git a/data/grid5000/sites/luxembourg/network_equipments/gw.json b/data/grid5000/sites/luxembourg/network_equipments/gw.json
index 282b91f4667..a3fdf9d350b 100644
--- a/data/grid5000/sites/luxembourg/network_equipments/gw.json
+++ b/data/grid5000/sites/luxembourg/network_equipments/gw.json
@@ -23,18 +23,6 @@
       "rate": 20000000000,
       "uid": "backup-link-to-hpc-gw"
     },
-    "port-channel43": {
-      "kind": "switch",
-      "port": "port-channel43",
-      "rate": 20000000000,
-      "uid": "sw-admin-b09"
-    },
-    "port-channel45": {
-      "kind": "switch",
-      "port": "port-channel45",
-      "rate": 20000000000,
-      "uid": "sw-admin-b04"
-    },
     "port-channel5": {
       "kind": "server",
       "port": "port-channel5",
@@ -49,13 +37,13 @@
     },
     "port-channel57": {
       "kind": "switch",
-      "port": "port-channel57",
+      "port": "port-channel53",
       "rate": 20000000000,
       "uid": "sw-b09"
     },
     "port-channel59": {
       "kind": "switch",
-      "port": "port-channel59",
+      "port": "port-channel53",
       "rate": 20000000000,
       "uid": "sw-b04"
     },
@@ -194,26 +182,17 @@
           "uid": "port-channel41"
         },
         {
-          "kind": "channel",
-          "snmp_name": "Ethernet1/43",
-          "uid": "port-channel43"
         },
         {
-          "kind": "channel",
-          "snmp_name": "Ethernet1/44",
-          "uid": "port-channel43"
         },
         {
-          "kind": "channel",
-          "snmp_name": "Ethernet1/45",
-          "uid": "port-channel45"
         },
         {
-          "kind": "channel",
-          "snmp_name": "Ethernet1/46",
-          "uid": "port-channel45"
         },
         {
+          "kind": "switch",
+          "snmp_name": "Ethernet1/47",
+          "uid": "gw-kirchberg"
         },
         {
           "kind": "backbone",
diff --git a/data/grid5000/sites/luxembourg/network_equipments/sw-b04.json b/data/grid5000/sites/luxembourg/network_equipments/sw-b04.json
index f6282c6484a..c47c75da735 100644
--- a/data/grid5000/sites/luxembourg/network_equipments/sw-b04.json
+++ b/data/grid5000/sites/luxembourg/network_equipments/sw-b04.json
@@ -3,9 +3,9 @@
   "channels": {
     "port-channel53": {
       "kind": "router",
-      "port": "port-channel53",
+      "port": "port-channel59",
       "rate": 200000000000,
-      "uid": "gw-belval"
+      "uid": "gw"
     }
   },
   "ip": "172.17.191.249",
@@ -21,60 +21,22 @@
         {
         },
         {
-          "kind": "node",
-          "port": "eth0",
-          "snmp_name": "Ethernet1/1",
-          "uid": "mi210x-1"
         },
         {
-          "kind": "node",
-          "port": "eth0",
-          "snmp_name": "Ethernet1/2",
-          "uid": "mi210x-2"
         },
         {
-          "kind": "node",
-          "port": "eth0",
-          "snmp_name": "Ethernet1/3",
-          "uid": "mi210x-3"
         },
         {
-          "kind": "node",
-          "port": "eth0",
-          "snmp_name": "Ethernet1/4",
-          "uid": "mi210x-4"
         },
         {
-          "kind": "node",
-          "port": "eth0",
-          "snmp_name": "Ethernet1/5",
-          "uid": "mi210x-5"
         },
         {
-          "kind": "node",
-          "port": "eth0",
-          "snmp_name": "Ethernet1/6",
-          "uid": "mi210x-6"
         },
         {
-          "kind": "node",
-          "port": "eth0",
-          "snmp_name": "Ethernet1/7",
-          "uid": "mi210x-7"
         },
         {
-          "kind": "node",
-          "port": "g-p1",
-          "rate": 10000000000,
-          "snmp_name": "Ethernet1/8",
-          "uid": "xe9680-10g-p1"
         },
         {
-          "kind": "node",
-          "port": "g-p2",
-          "rate": 10000000000,
-          "snmp_name": "Ethernet1/9",
-          "uid": "xe9680-10g-p2"
         },
         {
         },
diff --git a/data/grid5000/sites/luxembourg/network_equipments/sw-b09.json b/data/grid5000/sites/luxembourg/network_equipments/sw-b09.json
index 32783d7a16d..a488751f5f4 100644
--- a/data/grid5000/sites/luxembourg/network_equipments/sw-b09.json
+++ b/data/grid5000/sites/luxembourg/network_equipments/sw-b09.json
@@ -3,9 +3,9 @@
   "channels": {
     "port-channel53": {
       "kind": "router",
-      "port": "port-channel53",
+      "port": "port-channel57",
       "rate": 200000000000,
-      "uid": "gw-belval"
+      "uid": "gw"
     }
   },
   "ip": "172.17.191.248",
diff --git a/data/grid5000/sites/luxembourg/network_equipments/ul-grid5000-sw02.json b/data/grid5000/sites/luxembourg/network_equipments/ul-grid5000-sw02.json
index 2f804efc798..4ad2d98e179 100644
--- a/data/grid5000/sites/luxembourg/network_equipments/ul-grid5000-sw02.json
+++ b/data/grid5000/sites/luxembourg/network_equipments/ul-grid5000-sw02.json
@@ -5,7 +5,7 @@
       "kind": "router",
       "port": "Port-channel4",
       "rate": 20000000000,
-      "uid": "gw"
+      "uid": "gw-kirchberg"
     },
     "port-channel5": {
       "kind": "switch",
diff --git a/input/grid5000/sites/luxembourg/networks/gw-kirchberg.yaml b/input/grid5000/sites/luxembourg/networks/gw-kirchberg.yaml
new file mode 100644
index 00000000000..991ac791392
--- /dev/null
+++ b/input/grid5000/sites/luxembourg/networks/gw-kirchberg.yaml
@@ -0,0 +1,101 @@
+---
+gw-kirchberg:
+  model: cisco WS-C6506-E
+  kind: switch
+  managed_by_us: true
+  site: luxembourg
+  snmp_community: public
+  warranty: 2018-12-01
+  backplane_bps: 720000000000
+  ip: 172.16.191.240
+  metrics:
+    - name: network_ifacein_bytes_total
+      description: Input byte counter for the network device port
+      period: 5000
+      source:
+        protocol: snmp
+        id: 1.3.6.1.2.1.31.1.1.1.6.{{ 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: 5000
+      source:
+        protocol: snmp
+        id: 1.3.6.1.2.1.31.1.1.1.10.{{ 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: 5000
+      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: 5000
+      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: 5000
+      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: 5000
+      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: 5000
+      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: 5000
+      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% }}
+  linecards:
+    2:
+      snmp_pattern: GigabitEthernet%LINECARD%/%PORT%
+      kavlan_pattern: Gi%LINECARD%/%PORT%
+      backplane_bps: 40000000000
+      rate: 1000000000
+      kind: node
+      ports:
+        44:
+          uid: cronos
+          kind: server
+        48:
+    3:
+      snmp_pattern: TenGigabitEthernet%LINECARD%/%PORT%
+      kavlan_pattern: Ti%LINECARD%/%PORT%
+      rate: 10000000000
+      backplane_bps: 40000000000
+      kind: channel
+      ports:
+        1:
+          uid: Port-channel4
+          kind: channel
+        2:
+          uid: Port-channel4
+          kind: channel
+    5:
+      snmp_pattern: TenGigabitEthernet%LINECARD%/%PORT%
+      kavlan_pattern: Ti%LINECARD%/%PORT%
+      rate: 1000000000
+      backplane_bps: 40000000000
+      kind: router
+      ports:
+        4:
+          uid: gw
+          rate: 10000000000
+  channels:
+    Port-channel4:
+      uid: ul-grid5000-sw02
+      port: port-channel4
+      kind: switch
+      rate: 20000000000
+
diff --git a/input/grid5000/sites/luxembourg/networks/gw-luxembourg.yaml b/input/grid5000/sites/luxembourg/networks/gw-luxembourg.yaml
index b6e81565cc6..4d78e45619f 100644
--- a/input/grid5000/sites/luxembourg/networks/gw-luxembourg.yaml
+++ b/input/grid5000/sites/luxembourg/networks/gw-luxembourg.yaml
@@ -156,18 +156,9 @@ gw:
         42:
           uid: port-channel41
           kind: channel
-        43:
-          uid: port-channel43
-          kind: channel
-        44:
-          uid: port-channel43
-          kind: channel
-        45:
-          uid: port-channel45
-          kind: channel
-        46:
-          uid: port-channel45
-          kind: channel
+        47:
+          uid: gw-kirchberg
+          kind: switch
         48:
           uid: renater-luxembourg
           kind: backbone
@@ -215,16 +206,6 @@ gw:
       port: port-channel7
       kind: server
       rate: 20_000_000_000
-    port-channel43:
-      uid: sw-admin-b09
-      port: port-channel43
-      kind: switch
-      rate: 20_000_000_000
-    port-channel45:
-      uid: sw-admin-b04
-      port: port-channel45
-      kind: switch
-      rate: 20_000_000_000
     port-channel55:
       uid: srv-data
       port: port-channel55
@@ -232,11 +213,11 @@ gw:
       rate: 20_000_000_000
     port-channel57:
       uid: sw-b09
-      port: port-channel57
+      port: port-channel53
       kind: switch
       rate: 20_000_000_000
     port-channel59:
       uid: sw-b04
-      port: port-channel59
+      port: port-channel53
       kind: switch
       rate: 20_000_000_000
diff --git a/input/grid5000/sites/luxembourg/networks/sw-b04.yaml b/input/grid5000/sites/luxembourg/networks/sw-b04.yaml
index 56c3746068e..0ce79678e5c 100644
--- a/input/grid5000/sites/luxembourg/networks/sw-b04.yaml
+++ b/input/grid5000/sites/luxembourg/networks/sw-b04.yaml
@@ -65,26 +65,6 @@ sw-b04:
       rate: 25_000_000_000
       kind: node
       ports:
-        1:
-          uid: mi210x-1
-        2:
-          uid: mi210x-2
-        3:
-          uid: mi210x-3
-        4:
-          uid: mi210x-4
-        5:
-          uid: mi210x-5
-        6:
-          uid: mi210x-6
-        7:
-          uid: mi210x-7
-        8:
-          uid: xe9680-10g-p1
-          rate: 10_000_000_000
-        9:
-          uid: xe9680-10g-p2
-          rate: 10_000_000_000
         53:
           uid: port-channel53
           kind: channel
@@ -93,7 +73,7 @@ sw-b04:
           kind: channel
   channels:
     port-channel53:
-      uid: gw-belval
-      port: port-channel53
+      uid: gw
+      port: port-channel59
       kind: router
       rate: 200_000_000_000
diff --git a/input/grid5000/sites/luxembourg/networks/sw-b09.yaml b/input/grid5000/sites/luxembourg/networks/sw-b09.yaml
index d9fb37c2a6b..ae8574d329a 100644
--- a/input/grid5000/sites/luxembourg/networks/sw-b09.yaml
+++ b/input/grid5000/sites/luxembourg/networks/sw-b09.yaml
@@ -73,7 +73,7 @@ sw-b09:
           kind: channel
   channels:
     port-channel53:
-      uid: gw-belval
-      port: port-channel53
+      uid: gw
+      port: port-channel57
       kind: router
       rate: 200_000_000_000
diff --git a/input/grid5000/sites/luxembourg/networks/ul-grid5000-sw02.yaml b/input/grid5000/sites/luxembourg/networks/ul-grid5000-sw02.yaml
index 8b3a0df85b3..8f95262ef9d 100644
--- a/input/grid5000/sites/luxembourg/networks/ul-grid5000-sw02.yaml
+++ b/input/grid5000/sites/luxembourg/networks/ul-grid5000-sw02.yaml
@@ -126,7 +126,7 @@ ul-grid5000-sw02:
           kind: channel
   channels:
     port-channel4:
-      uid: gw
+      uid: gw-kirchberg
       port: Port-channel4
       kind: router
       rate: 20000000000
-- 
GitLab