From 26573555a9d32f071ad287cba2e6499f12351ced Mon Sep 17 00:00:00 2001 From: Felix <7132415+TerraTalpi@users.noreply.github.com> Date: Mon, 29 Apr 2024 10:24:34 +0200 Subject: [PATCH 1/5] aoscx: fix actual power-consumption included in environment output Exclude actual power consumption from output. Command "show environment power-consumption" has been introduced with ArubaOS-CX Long Support Release (LSR) version FL.10.13.xxx. This was not included in the previous LSR FL.10.10.xxx. Related issue is https://github.com/ytti/oxidized/issues/3142. Based on the work of @danpoltawski --- lib/oxidized/model/aoscx.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/oxidized/model/aoscx.rb b/lib/oxidized/model/aoscx.rb index 726f649a7..eda6efcc3 100644 --- a/lib/oxidized/model/aoscx.rb +++ b/lib/oxidized/model/aoscx.rb @@ -59,6 +59,7 @@ class Aoscx < Oxidized::Model cfg.gsub! /^(\d+\/\S+\s+\S+\s+)\d+\.\d+\s+C(.*)/, '\\1\\2' cfg.gsub! /^(LC.*\s+)\d+\.\d+\s+(C.*)$/, '\\1 \\2' cfg.gsub! /^(\S+\s+\S+\s+\s+\S+\s+)(slow|normal|medium|fast|max)(\s+\S+\s+\S+\s+)\d+/, '\\1\\3' + cfg.gsub! /^(\d+\s+.+\s+)(\s\s\d+\.\d+)(\s+)(\s\s\d+\.\d+)$/, '\\1\\3' comment cfg end From b31e2c8f1b15bd37115202a92a206e51118bfd0f Mon Sep 17 00:00:00 2001 From: Felix <7132415+TerraTalpi@users.noreply.github.com> Date: Mon, 29 Apr 2024 10:30:35 +0200 Subject: [PATCH 2/5] CHANGELOG: add ArubaOS-CX power consumption fix Exclude actual power consumption from output. Command "show environment power-consumption" has been introduced with ArubaOS-CX Long Support Release (LSR) version FL.10.13.xxx. This was not included in the previous LSR FL.10.10.xxx. Related issue is #3142. Based on the work of @danpoltawski --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 07672fa18..8213a2f08 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). ### Fixed - fixed prompt for vyos/vyatta to allow logins with non-priviliged accounts. Fixes #3111 (@h-lopez) - +- fixed power consumption included in ArubaOS-CX diffs starting with FL.10.13.xxx. Fixes #3142 (@terratalpi) ## [0.30.1 – 2024-04-12] From 2e0c648ded87dbf58a4e2fe4ff5a8e5342921d96 Mon Sep 17 00:00:00 2001 From: Felix <7132415+TerraTalpi@users.noreply.github.com> Date: Fri, 3 May 2024 11:26:48 +0200 Subject: [PATCH 3/5] aoscx: fix power consumption for up to a four digit watt value fixes power consumptipon for up to a for digit number and keep table formatting. Starting with ArubaOS-CX Version FL.10.13.xxx --- lib/oxidized/model/aoscx.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/oxidized/model/aoscx.rb b/lib/oxidized/model/aoscx.rb index eda6efcc3..0ed8a117d 100644 --- a/lib/oxidized/model/aoscx.rb +++ b/lib/oxidized/model/aoscx.rb @@ -59,7 +59,7 @@ class Aoscx < Oxidized::Model cfg.gsub! /^(\d+\/\S+\s+\S+\s+)\d+\.\d+\s+C(.*)/, '\\1\\2' cfg.gsub! /^(LC.*\s+)\d+\.\d+\s+(C.*)$/, '\\1 \\2' cfg.gsub! /^(\S+\s+\S+\s+\s+\S+\s+)(slow|normal|medium|fast|max)(\s+\S+\s+\S+\s+)\d+/, '\\1\\3' - cfg.gsub! /^(\d+\s+.+\s+)(\s\s\d+\.\d+)(\s+)(\s\s\d+\.\d+)$/, '\\1\\3' + cfg.gsub! /^(\d+\s+.+\s+)(\s{2}\d{2}\.\d{2}|\s{1}\d{3}\.\d{2}|\d{4}\.\d{2})(\s+)(\s{2}\d{2}\.\d{2}|\s{1}\d{3}\.\d{2}|\d{4}\.\d{2})$/, '\\1\\3' comment cfg end From 5c87c7938220d5a688e67cb8be4d2626ed81b096 Mon Sep 17 00:00:00 2001 From: Felix <7132415+TerraTalpi@users.noreply.github.com> Date: Wed, 8 May 2024 08:47:32 +0200 Subject: [PATCH 4/5] aoscx.rb: add power consumption support for 6400, 8400 and chassis switches --- lib/oxidized/model/aoscx.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/oxidized/model/aoscx.rb b/lib/oxidized/model/aoscx.rb index 0ed8a117d..b095a826a 100644 --- a/lib/oxidized/model/aoscx.rb +++ b/lib/oxidized/model/aoscx.rb @@ -59,7 +59,20 @@ class Aoscx < Oxidized::Model cfg.gsub! /^(\d+\/\S+\s+\S+\s+)\d+\.\d+\s+C(.*)/, '\\1\\2' cfg.gsub! /^(LC.*\s+)\d+\.\d+\s+(C.*)$/, '\\1 \\2' cfg.gsub! /^(\S+\s+\S+\s+\s+\S+\s+)(slow|normal|medium|fast|max)(\s+\S+\s+\S+\s+)\d+/, '\\1\\3' + # match show environment power-consumption on VSF or standadlone, non-chassis and non-6400 switch, e.g. "2 6300M 48G 4SFP56 Swch 156.00 155.94" cfg.gsub! /^(\d+\s+.+\s+)(\s{2}\d{2}\.\d{2}|\s{1}\d{3}\.\d{2}|\d{4}\.\d{2})(\s+)(\s{2}\d{2}\.\d{2}|\s{1}\d{3}\.\d{2}|\d{4}\.\d{2})$/, '\\1\\3' + # match show environment power-consumption on 6400 or chassis switches, e.g. "1/4 line-card-module R0X39A 6400 48p 1GbE CL4 PoE 4SFP56 Mod 54 W" + cfg.gsub! /^(\d+\/\d+\s+.+\s+)(\s{3}\d{1}|\s{2}\d{2}|\s{1}\d{3}|\d{4})\sW\s*$/, '\\1' + # match show environment power-consumption on 6400 or chassis switches, e.g. "Module Total Power Usage 13000 W", match up to a 5-digit number and keep table formatting. + cfg.gsub! /^(Module|Chassis)\s(Total\sPower\sUsage)(\s+)\s(\s{4}\d{1}|\s{3}\d{2}|\s{2}\d{3}|\s{1}\d{4}|\d{5})\sW\s*$/, '\\1 ' + # match show environment power-consumption on 6400 or chassis switches, e.g. "Chassis Total Power Usage 13000 W", match up to a 5-digit number and keep table formatting. + cfg.gsub! /^(Chassis\sTotal\sPower\sUsage)(\s+)(\s{4}\d{1}|\s{3}\d{2}|\s{2}\d{3}|\s{1}\d{4}|\d{5})\sW\s*$/, '\\1\\2' + # match show environment power-consumption on 8400 or chassis switches, up to a 5-digit number, example matches: + # e.g. "Chassis Total Power Allocated (total of all max wattages) 4130 W" + # e.g. "Chassis Total Power Unallocated 15860 W" + cfg.gsub! /^(Chassis\sTotal\sPower\s)(Allocated|Unallocated)(\s|\s\(total of all max wattages\))(\s+)(\s{4}\d{1}|\s{3}\d{2}|\s{2}\d{3}|\s{1}\d{4}|\d{5})\sW\s*$/, '\\1\\2\\3\\4' + # match Total Power Consumption: + cfg.gsub! /^([t|T]otal\s[p|P]ower\s[c|C]onsumption\s+)(\d+\.\d\d)$/, '\\1' comment cfg end From 88e40bcbe912e6bf203359adc3e81f09eaba1965 Mon Sep 17 00:00:00 2001 From: Felix <7132415+TerraTalpi@users.noreply.github.com> Date: Mon, 13 May 2024 10:24:48 +0200 Subject: [PATCH 5/5] aoscx.rb: remove trailing white spaces remove trailing white spaces of line "# match Total Power consumption:" --- lib/oxidized/model/aoscx.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/oxidized/model/aoscx.rb b/lib/oxidized/model/aoscx.rb index b095a826a..cdfbf4735 100644 --- a/lib/oxidized/model/aoscx.rb +++ b/lib/oxidized/model/aoscx.rb @@ -71,7 +71,7 @@ class Aoscx < Oxidized::Model # e.g. "Chassis Total Power Allocated (total of all max wattages) 4130 W" # e.g. "Chassis Total Power Unallocated 15860 W" cfg.gsub! /^(Chassis\sTotal\sPower\s)(Allocated|Unallocated)(\s|\s\(total of all max wattages\))(\s+)(\s{4}\d{1}|\s{3}\d{2}|\s{2}\d{3}|\s{1}\d{4}|\d{5})\sW\s*$/, '\\1\\2\\3\\4' - # match Total Power Consumption: + # match Total Power Consumption: cfg.gsub! /^([t|T]otal\s[p|P]ower\s[c|C]onsumption\s+)(\d+\.\d\d)$/, '\\1' comment cfg end