Commit 73dade62 authored by Andrey Vertiprahov's avatar Andrey Vertiprahov
Browse files

Merge branch 'fix-avs-huawei' into 'master'

Huawei. Disable CLI metrics.

See merge request !3337
parents de03e15f 3d1de7cc
Pipeline #21340 passed with stages
in 73 minutes and 32 seconds
......@@ -62,6 +62,7 @@ class Profile(BaseProfile):
matchers = {
"is_gpon_uplink": {"platform": {"$in": ["MA5626G"]}},
"is_dslam": {"platform": {"$in": ["MA5600"]}},
"is_ua5k": {"platform": {"$in": ["UA5000"]}},
}
rx_slots = re.compile(r"^\s*\d+", re.MULTILINE)
......
......@@ -9,11 +9,8 @@
# Python modules
from __future__ import absolute_import
# Third-party modules
import six
# NOC modules
from noc.sa.profiles.Generic.get_metrics import Script as GetMetricsScript, metrics
from noc.sa.profiles.Generic.get_metrics import Script as GetMetricsScript
from .oidrules.slot import SlotRule
from .oidrules.sslot import SSlotRule
......@@ -23,19 +20,19 @@ class Script(GetMetricsScript):
OID_RULES = [SlotRule, SSlotRule]
@metrics(
["Interface | Errors | CRC", "Interface | Errors | Frame"],
has_capability="DB | Interfaces",
volatile=False,
access="C", # CLI version
)
def get_vrp_interface_metrics(self, metrics):
v = self.cli("display interface")
ifdata = self.profile.parse_ifaces(v)
for iface, data in six.iteritems(ifdata):
iface = self.profile.convert_interface_name(iface)
ipath = ["", "", "", iface]
if "CRC" in data:
self.set_metric(id=("Interface | Errors | CRC", ipath), value=int(data["CRC"]))
if "Frames" in data:
self.set_metric(id=("Interface | Errors | Frame", ipath), value=int(data["Frames"]))
# @metrics(
# ["Interface | Errors | CRC", "Interface | Errors | Frame"],
# has_capability="DB | Interfaces",
# volatile=False,
# access="C", # CLI version
# )
# def get_vrp_interface_metrics(self, metrics):
# v = self.cli("display interface")
# ifdata = self.profile.parse_ifaces(v)
# for iface, data in six.iteritems(ifdata):
# iface = self.profile.convert_interface_name(iface)
# ipath = ["", "", "", iface]
# if "CRC" in data:
# self.set_metric(id=("Interface | Errors | CRC", ipath), value=int(data["CRC"]))
# if "Frames" in data:
# self.set_metric(id=("Interface | Errors | Frame", ipath), value=int(data["Frames"]))
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment