lib/logstash/inputs/snmp/client.rb in logstash-input-snmp-1.2.3 vs lib/logstash/inputs/snmp/client.rb in logstash-input-snmp-1.2.4
- old
+ new
@@ -16,10 +16,18 @@
java_import "org.snmp4j.util.DefaultPDUFactory"
def initialize(protocol, address, port, community, version, retries, timeout, mib)
super(protocol, address, port, retries, timeout, mib)
raise(SnmpClientError, "SnmpClient is expecting verison '1' or '2c'") unless ["1", "2c"].include?(version.to_s)
+
+ @snmp = Snmp.new(create_transport(protocol))
+ @snmp.listen
+
@target = build_target("#{protocol}:#{address}/#{port}", community, version, retries, timeout)
+ end
+
+ def close
+ @snmp.close
end
private
def get_pdu