Commit fb5ece07 authored by MaksimSmile13's avatar MaksimSmile13
Browse files

Update Ericsson.SEOS Profile

parent 8443dceb
# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------
# Vendor: Ericsson
# OS: SEOS
# ---------------------------------------------------------------------
# Copyright (C) 2007-2019 The NOC Project
# See LICENSE for details
# ---------------------------------------------------------------------
# Python modules
import re
# NOC modules
from noc.core.profile.base import BaseProfile
class Profile(BaseProfile):
"""
For correct polling on snmp it is necessary to enable "snmp extended read" in settings
"""
name = "Ericsson.SEOS"
pattern_more = "^---(more)---"
pattern_unprivileged_prompt = \
r"^(?:\[(?P<context>\S+)\])?(?P<hostname>\S+)>"
pattern_prompt = r"^(?:\[(?P<context>\S+)\])?(?P<hostname>\S+)#"
pattern_syntax_error = r"% Invalid input at|% ERROR Invalid input detected"
command_disable_pager = "terminal length 0"
command_super = "enable"
command_enter_config = "configure"
command_leave_config = "exit"
rogue_chars = [re.compile(r"\x08{4,}\S+"), "\r"]
......@@ -6,6 +6,8 @@
# See LICENSE for details
# ---------------------------------------------------------------------
# Third-party modules
import six
# NOC modules
from noc.sa.profiles.Generic.get_interface_status_ex import Script as BaseScript
from noc.sa.interfaces.igetinterfacestatusex import IGetInterfaceStatusEx
......@@ -76,7 +78,7 @@ class Script(BaseScript):
# Log unknown interfaces
if unknown_interfaces:
self.logger.info("%d unknown interfaces has been ignored", len(unknown_interfaces))
for ifindex, rr in radio.iteritems():
for ifindex, rr in six.iteritems(radio):
rr["in_speed"] = self.snmp.get("1.3.6.1.4.1.193.81.3.4.1.1.14.1.7.1")
rr["out_speed"] = self.snmp.get("1.3.6.1.4.1.193.81.3.4.1.1.14.1.7.1")
res[ifindex] = rr
......
......@@ -28,8 +28,11 @@ class Script(BaseScript):
def execute_cli(self):
objects = []
v = self.cli("show hardware")
media = self.cli("show port trans")
try:
v = self.cli("show hardware")
media = self.cli("show port trans")
except self.CLISyntaxError:
raise self.NotSupportedError("Not supported on")
for l in v.splitlines():
if "backplane" in l:
objects += [{
......
# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------
# Vendor: Ericsson
# OS: SEOS
# ---------------------------------------------------------------------
# Copyright (C) 2007-2019 The NOC Project
# See LICENSE for details
# ---------------------------------------------------------------------
# Python modules
import re
# NOC modules
from noc.core.profile.base import BaseProfile
class Profile(BaseProfile):
"""
For correct polling on snmp it is necessary to enable "snmp extended read" in settings
"""
name = "Ericsson.SEOS"
pattern_more = "^---(more)---"
pattern_unprivileged_prompt = \
r"^(?:\[(?P<context>\S+)\])?(?P<hostname>\S+)>"
pattern_prompt = r"^(?:\[(?P<context>\S+)\])?(?P<hostname>\S+)#"
pattern_syntax_error = r"% Invalid input at|% ERROR Invalid input detected"
command_disable_pager = "terminal length 0"
command_super = "enable"
command_enter_config = "configure"
command_leave_config = "exit"
rogue_chars = [re.compile(r"\x08{4,}\S+"), "\r"]
rx_ifname = re.compile("\S+\s+\d+\/\d+\/\d+")
def convert_interface_name(self, s):
"""
>>> Profile().convert_interface_name("LAN 1/1/8")
'1/1/8-LAN'
>>> Profile().convert_interface_name("1/1/8-LAN")
'1/1/8-LAN'
"""
match = self.rx_ifname.match(s)
if match:
iface = s.split()
return "%s-%s" % (iface[1], iface[0])
else:
return s
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