From 4b4aa82f183052e8dd53365c7e9eb25c2e44f23f Mon Sep 17 00:00:00 2001 From: bee26 Date: Mon, 1 Feb 2021 11:38:55 +0300 Subject: [PATCH] fix metrics "Subscribers | Summary" Alcatel.TIMOS --- sa/profiles/Alcatel/TIMOS/get_metrics.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/sa/profiles/Alcatel/TIMOS/get_metrics.py b/sa/profiles/Alcatel/TIMOS/get_metrics.py index 7f626abdc1..95a8e72993 100644 --- a/sa/profiles/Alcatel/TIMOS/get_metrics.py +++ b/sa/profiles/Alcatel/TIMOS/get_metrics.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------- # Alcatel.TIMOS.get_metrics # ---------------------------------------------------------------------- -# Copyright (C) 2007-2020 The NOC Project +# Copyright (C) 2007-2021 The NOC Project # See LICENSE for details # ---------------------------------------------------------------------- @@ -19,30 +19,36 @@ class Script(GetMetricsScript): access="S", ) def get_subscribers_metrics_snmp(self, metrics): + """ + total sessions ['0', '', '', ''] + slot sessions ['0', , '', ''] + module sessions ['0', '', , ''] + port sessions ['0', '', '', ] + """ for oid, v in self.snmp.getnext("1.3.6.1.4.1.6527.3.1.2.33.1.106.1.2.1", bulk=False): oid2 = oid.split("1.3.6.1.4.1.6527.3.1.2.33.1.106.1.2.1.") slot = "slot " slot += str(oid2[1]) self.set_metric( id=("Subscribers | Summary", None), - path=("0", slot, "slot"), + path=("0", slot, "", ""), value=int(v), multi=True, ) names = {x: y for y, x in self.scripts.get_ifindexes().items()} for oid, v in self.snmp.getnext("1.3.6.1.4.1.6527.3.1.2.33.1.104.1.60.1", bulk=False): oid2 = oid.split("1.3.6.1.4.1.6527.3.1.2.33.1.104.1.60.1.") - iface_name = names[int(oid2[1])] + port = names[int(oid2[1])] self.set_metric( id=("Subscribers | Summary", None), - path=("0", iface_name, "port"), + path=("0", "", "", port), value=int(v), multi=True, ) metric = self.snmp.get("1.3.6.1.4.1.6527.3.1.2.33.5.9.1.2.1") self.set_metric( id=("Subscribers | Summary", None), - path=("0", "Total Subscribers", ""), + path=("0", "", "", ""), value=int(metric), multi=True, ) -- GitLab