Class: SNMPTableViewer::Converter::IfTable

Inherits:
SNMPTableViewer::Converter show all
Defined in:
lib/snmp_table_viewer/converter/if_table.rb

Overview

Converter for the interface table.

Replaces type with "number (meaning)"
Replaces admin state with "number (meaning)"
Replaces oper state with "number (meaning)"
Replaces last change with "Timeticks: (number) D days, H:M:S.ms"

Class Method Summary collapse

Class Method Details

.convert(data) ⇒ Object



14
15
16
17
18
19
20
21
22
# File 'lib/snmp_table_viewer/converter/if_table.rb', line 14

def self.convert(data)
  data.map do |item|
    item[2] = "#{item[2]} (#{TYPES[item[2]]})"
    item[6] = "#{item[6]} (#{ADMIN_STATES[item[6]-1]})"
    item[7] = "#{item[7]} (#{OPER_STATES[item[7]-1]})" 
    item[8] = item[8].to_s # Timeticks for last change
    item
  end
end