Commit c5b6e0b3 authored by Dmitry Volodin's avatar Dmitry Volodin
Browse files

Raisecom.ROS profile

parent 7cab3430
# -*- coding: utf-8 -*-
##----------------------------------------------------------------------
## Vendor: Raisecom
## OS: ROS
##----------------------------------------------------------------------
## Copyright (C) 2007-2009 The NOC Project
## See LICENSE for details
##----------------------------------------------------------------------
"""
"""
import noc.sa.profiles
from noc.sa.protocols.sae_pb2 import TELNET,SSH
class Profile(noc.sa.profiles.Profile):
name="Raisecom.ROS"
supported_schemes=[TELNET,SSH]
pattern_more="^ --More--"
pattern_unpriveleged_prompt=r"^\S+?>"
command_super="enable"
pattern_prompt=r"^\S+?#"
command_more=" "
# -*- coding: utf-8 -*-
##----------------------------------------------------------------------
## Raisecom.ROS.get_config
##----------------------------------------------------------------------
## Copyright (C) 2007-2009 The NOC Project
## See LICENSE for details
##----------------------------------------------------------------------
"""
"""
import noc.sa.script
from noc.sa.interfaces import IGetConfig
class Script(noc.sa.script.Script):
name="Raisecom.ROS.get_config"
implements=[IGetConfig]
def execute(self):
config=self.cli("show running-config")
config=self.strip_first_lines(config,1)
return self.cleaned_config(config)
# -*- coding: utf-8 -*-
##----------------------------------------------------------------------
## Raisecom.ROS.get_version
##----------------------------------------------------------------------
## Copyright (C) 2007-2009 The NOC Project
## See LICENSE for details
##----------------------------------------------------------------------
"""
"""
import noc.sa.script
from noc.sa.interfaces import IGetVersion
import re
rx_ver=re.compile(r"^Product name:\s+(?P<platform>\S+).*ROS Version ROS_(?P<version>.+?)\.\(Compiled",re.MULTILINE|re.DOTALL)
class Script(noc.sa.script.Script):
name="Raisecom.ROS.get_version"
implements=[IGetVersion]
def execute(self):
v=self.cli("show version")
match=rx_ver.search(v)
return {
"vendor" : "Raisecom",
"platform" : match.group("platform"),
"version" : match.group("version"),
}
# -*- coding: utf-8 -*-
##----------------------------------------------------------------------
## Raisecom.ROS highlight lexers
##----------------------------------------------------------------------
## Copyright (C) 2007-2009 The NOC Project
## See LICENSE for details
##----------------------------------------------------------------------
from pygments.lexer import RegexLexer,bygroups,include
from pygments.token import *
##
## Cisco IOS configuration lexer
##
class ConfigLexer(RegexLexer):
name="Raisecom.ROS"
tokens={
"root" : [
(r"^!.*", Comment),
(r"(description)(.*?)$", bygroups(Keyword,Comment)),
(r"^(interface|vlan)(.*?)$", bygroups(Keyword,Name.Attribute)),
(r"\d+", Number),
(r".", Text),
],
}
Raisecom,ISCOM2008,3.8.1146.ISCOM2008.74.20081107
\ No newline at end of file
Raisecom.ROS
============
====== =========================================
Vendor `Raisecom <http://www.naraisecom.com/>`_
OS ROS
====== =========================================
Raisecom.ROS profile supports Raisecom's family of ethernet switches.
Tested Equipment
----------------
.. supported:: Raisecom.ROS
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