Changes between Version 16 and Version 17 of Internal/OpenFlow/SandBoxSetup


Ignore:
Timestamp:
Sep 3, 2009, 9:13:15 PM (15 years ago)
Author:
akoshibe
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Internal/OpenFlow/SandBoxSetup

    v16 v17  
    368368 
    369369for a more detailed look, the tutorial: http://net-snmp.sourceforge.net/wiki/index.php/TUT:snmpset
     370== Using Ruby scripts ==
     371libsnmp reference: http://snmplib.rubyforge.org/doc/index.html
     372
     373Ruby has libsnmp-ruby, a library for SNMP, available. SB9 didn't come with it, so it was installed:
     374{{{
     375apt-get install libsnmp-ruby
     376}}}
     377A messy irb test of the library:
     378{{{
     379irb(main):002:0> require 'snmp'
     380irb(main):004:0> agent_hostname = "172.16.100.10"
     381=> "172.16.100.10"
     382irb(main):005:0> agent_comm = "NET"
     383=> "NET"
     384irb(main):007:0> s = SNMP::Manager.new(:Host => agent_hostname, :Community =>agent_comm, :Port => 161)
     385=> #<SNMP::Manager:0xb79d5d98 @snmp_version=:SNMPv2c, @port=161, @transport=#<SNMP::UDPTransport:0xb79d5d5c @socket=#<UDPSocket:0xb79d5d34>>, @write_community="NET", @host="172.16.100.10", @retries=5, @community="NET", @mib=#<SNMP ... #this goes on for a while
     386irb(main):009:0> response = s.get(["1.3.6.1.2.1.1.1.0"])
     387=> #<SNMP::Response:0xb79c2d10 @error_index=0, @error_status=0, @request_id=856260869, @varbind_list=[#<SNMP::VarBind:0xb79c2900 @value="ALAXALA AX3640S AX-3640-48T2XW-L [AX3640S-48T2XW] Switching software Ver. 10.7 [OS-L3L]", @name=[1.3.6.1.2.1.1.1.0]>]>
     388irb(main):035:0> rstring = "#{response.varbind_list.to_s}"
     389=> "[name=1.3.6.1.2.1.1.1.0, value=ALAXALA AX3640S AX-3640-48T2XW-L [AX3640S-48T2XW] Switching software Ver. 10.7 [OS-L3L] (OCTET STRING)]"
     390}}}
    370391
    371392[[BR]]