Class: SNMP::VarBind

Inherits:
Object
  • Object
show all
Defined in:
lib/netcrawl/snmp.rb

Instance Method Summary collapse

Instance Method Details

#as_ipString

Returns VarBind value as IP address.

Returns:

  • (String)

    VarBind value as IP address



131
132
133
# File 'lib/netcrawl/snmp.rb', line 131

def as_ip
  SNMP::IpAddress.new(value).to_s
end

#oid_id(root) ⇒ Array

Returns oid remaining after specified root oid.

Parameters:

  • root (String)

    oid which is removed from self.oid

Returns:

  • (Array)

    oid remaining after specified root oid



136
137
138
139
# File 'lib/netcrawl/snmp.rb', line 136

def oid_id root
  root = root.split('.').map{|e|e.to_i}
  oid[root.size..-1]
end