Module: Cow::ACS6000::Server

Included in:
Cow::ACS6000::SSH::Server, Telnet::Server
Defined in:
lib/cow/plugins/acs6000.rb

Instance Method Summary collapse

Instance Method Details

#get_portsObject



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/cow/plugins/acs6000.rb', line 18

def get_ports
  ret = []
  snmp do |s|
    s.walk(OID_DESCRIPTION_LIST) do |x|
      next if x.name.last.zero?
      next unless (/^[0-9a-f]{2}-[0-9a-f]{2}-[0-9a-f]{2}-p-[0-9]+$/ =~ x.value.to_s).nil?
      port = x.name.last
      name = x.value.to_s
      tcp_port = TCP_PORT_OFFSET + port.to_i

      ret << Cow::ACS6000::Port.new(port, name, tcp_port)
    end
  end

  ret
end

#port(_port) ⇒ Object



13
14
15
16
# File 'lib/cow/plugins/acs6000.rb', line 13

def port(_port)
  return _port if _port.class == Cow::ACS6000::Port
  super
end