Module: Cow::Cisco::Server
- Included in:
- Cow::Cisco::SSH::Server, Telnet::Server
- Defined in:
- lib/cow/plugins/cisco.rb
Instance Method Summary collapse
Instance Method Details
#get_ports ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/cow/plugins/cisco.rb', line 18 def get_ports ret = [] snmp do |s| s.walk(OID_DESCRIPTION_LIST) do |x| next if x.name.last.zero? next if x.value.to_s.empty? port = x.name.last name = x.value.to_s tcp_port = TCP_PORT_OFFSET + port.to_i ret << Cow::Cisco::Port.new(port, name, tcp_port) end end ret end |
#port(_port) ⇒ Object
13 14 15 16 |
# File 'lib/cow/plugins/cisco.rb', line 13 def port(_port) return _port if _port.class == Cow::Cisco::Port super end |