Class: Hotwired::Model

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

Class Method Summary collapse

Class Method Details

.map(sysDescr, sysObjectID) ⇒ Object



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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/hotwired/model.rb', line 5

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 /JUNOS/
    "junos"
  when /Arista Networks EOS/
    "eos"
  when /IronWare/
    "ironware"
  when /TiMOS/
    "timos"
  when /ExtremeXOS/
    "xos"
  when /Cisco Adaptive Security Appliance/
    "asa"
  when /Brocade Fibre Channel Switch/
    "fabricos"
  when /Brocade VDX/
    "nos"
  when /cisco/i, /Application Control Engine/i
    "ios"
  when /Force10 OS/
    "ftos"
  when /Versatile Routing Platform/
    "vrp"
  when /^NetScreen/, /^SSG-\d+/
    "screenos"
  when /^Summit/
    "xos"
  when /^Alcatel-Lucent \S+ [789]\./ # aos <7 is vxworks, >=7 is linux
    "aos7"
  when /^AOS-W/
    "aosw"
  when /^Alcatel-Lucent/
    "aos"
  when /\s+ACOS\s+/
    "acos"
  when /ProCurve/ # ProCurve OS does not seem to have name?
    "procurve"
  when /ASAM/
    "isam"
  when /^\d+[A-Z]\sEthernet Switch$/
    "powerconnect"
  when /Ericsson IPOS/
    "ssr"
  when /Huawei Integrated Access Software/
    "hias"
  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
    when Regexp.new("^" + Regexp.quote("1.3.6.1.4.1.6027."))
      "ftos" # 1.3.6.1.4.1.6027.1.3.4
    when Regexp.new("^" + Regexp.quote("1.3.6.1.4.1.1588."))
      "fabricos " # 1.3.6.1.4.1.1588.2.1.1.1
    when Regexp.new("^" + Regexp.quote("1.3.6.1.4.1.3224."))
      "screenos" # 1.3.6.1.4.1.3224.1.51 (SSG) 1.16 (Netscreen 2k)
    when Regexp.new("^" + Regexp.quote("1.3.6.1.4.1.674."))
      "powerconnect" # 1.3.6.1.4.1.674.10895.3031
    when Regexp.new("^" + Regexp.quote("1.3.6.1.4.1.22610."))
      "acos" # 1.3.6.1.4.1.22610.1.3.14
    when Regexp.new("^" + Regexp.quote(".1.3.6.1.4.1.637."))
      "isam" # 1.3.6.1.4.1.637.61.1
    when Regexp.new("^" + Regexp.quote(".1.3.6.1.4.1.2011."))
      "vrp" # 1.3.6.1.4.1.2011.2.224.67 (AR1220F)
    when Regexp.new("^" + Regexp.quote(".1.3.6.1.4.1.1588."))
      "nos" # 1.3.6.1.4.1.1588.2.2.1.1.1.5 (VDX)
    when Regexp.new("^" + Regexp.quote(".1.3.6.1.4.1.1916."))
      "xos" # 1.3.6.1.4.1.1916.2.76 (X450a-48t)
    when Regexp.new("^" + Regexp.quote("1.3.6.1.4.1.9.1.745"))
      "asa" # 1.3.6.1.4.1.9.1.745
    when Regexp.new("^" + Regexp.quote("1.3.6.1.4.1.20858.2.600"))
      "casa" # 1.3.6.1.4.1.20858.2.600
    when Regexp.new("^" + Regexp.quote("1.3.6.1.4.1.2011.2.169"))
      "hias" # 1.3.6.1.4.1.2011.2.169
    when Regexp.new("^" + Regexp.quote("1.3.6.1.4.1.2011.2.300"))
      "hias" # 1.3.6.1.4.1.2011.2.300 (MA5800 OLT)
    when Regexp.new("^" + Regexp.quote("1.3.6.1.4.1.2352.1"))
      "ssr" # 1.3.6.1.4.1.2352.1.17 and .18
    when Regexp.new("^" + Regexp.quote("1.3.6.1.4.1.193.218.1"))
      "ssr" # 1.3.6.1.4.1.193.218.1.17 and .18
    when Regexp.new("^" + Regexp.quote("1.3.6.1.4.1.11.2.3.7.11"))
      "procurve" # Aruba switches are really HP Procurve
    else
      "unsupported"
    end
  end
end