Class: Corona::Model

Inherits:
Object
  • Object
show all
Defined in:
lib/corona/model.rb

Class Method Summary collapse

Class Method Details

.map(sysDescr, sysObjectID) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/corona/model.rb', line 3

def self.map sysDescr, sysObjectID
  case sysDescr
  when /Cisco Catalyst Operating System/i
    'catos'
  when /Cisco Controller/
    'aireos'
  when /IOS XR/
    'iosxr'
  when /NX-OS/
    'nxos'
  when /cisco/i, /Application Control Engine/i
    'ios'
  when /JUNOS/
    'junos'
  when /^NetScreen/, /^SSG-\d+/
    'screenos'
  when /Arista Networks EOS/
    'eos'
  when /IronWare/
    'ironware'
  when /^Summit/
    'xos'
  when /TiMOS/
    'timos'
  when /^Alcatel-Lucent \S+ [789]\./  #aos <7 is vxworks, >=7 is linux
    'aos7'
  when /^AOS-W/
    'aosw'
  when /^Alcatel-Lucent/
    'aos'
  when /^AX Series/
    'acos'
  when /ProCurve/  # ProCurve OS does not seem to have name?
    'procurve'
  when /^\d+[A-Z]\sEthernet Switch$/
    'powerconnect'
  else
    case sysObjectID
    when Regexp.new('^' + Regexp.quote('1.3.6.1.4.1.12356.'))
      'fortios' # 1.3.6.1.4.1.12356.101.1.10004
    when Regexp.new('^' + Regexp.quote('1.3.6.1.4.1.6486.'))
      'aos'     # 1.3.6.1.4.1.6486.800.1.1.2.1.11.2.2
    else
      'unsupported'
    end
  end
end