Sha256: 901df2626e1018451e1ba103b5b3ba625215436893dd4c1f2521987781d32f78
Contents?: true
Size: 599 Bytes
Versions: 1
Compression:
Stored size: 599 Bytes
Contents
require 'snmpjr/wrappers/transport' class Snmpjr class Session def initialize @snmp = Snmpjr::Wrappers::Snmp.new(Snmpjr::Wrappers::Transport::DefaultUdpTransportMapping.new) end def start @snmp.listen end def send pdu, target begin result = @snmp.send(pdu, target) if result.response.nil? "Error: Request timed out" else result.response.variable_bindings.first.variable.to_s end rescue Exception => e "Error: #{e.to_s}" end end def close @snmp.close end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
snmpjr-0.1.3-java | lib/snmpjr/session.rb |