SNMP Trap listener died

I use snmp trap input plugin to import log from switch.This is my logstash config
input {
snmptrap {
type => "snmptrap"
port => 162
host => "192.168.1.254"
community => "cisco"
yamlmibdir => "/opt/logstash/vendor/bundle/jruby/1.9/gems/snmp-1.2.0/data/ruby/snmp/mibs/"
}
}
filter { }
output {
stdout { codec => rubydebug }
}

and this is error code
SNMP Trap listener died {:exception=>#<SocketError: bind: name or service not known>, :backtrace=>["org/jruby/ext/socket/RubyUDPSocket.java:160:in bind'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/snmp-1.2.0/lib/snmp/manager.rb:540:ininitialize'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/snmp-1.2.0/lib/snmp/manager.rb:585:in create_transport'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/snmp-1.2.0/lib/snmp/manager.rb:618:ininitialize'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-snmptrap-2.0.4/lib/logstash/inputs/snmptrap.rb:74:in build_trap_listener'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-snmptrap-2.0.4/lib/logstash/inputs/snmptrap.rb:78:insnmptrap_listener'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-snmptrap-2.0.4/lib/logstash/inputs/snmptrap.rb:53:in run'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-5.0.0.alpha1-java/lib/logstash/pipeline.rb:388:ininputworker'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-5.0.0.alpha1-java/lib/logstash/pipeline.rb:382:in `start_input'"], :level=>:warn}

@sawwinnnaung Hello,

I have a few questions:

  • Everytime you start Logstash you are getting this error?
  • Are you getting this at starting or after processing some events.
  • Are you running the process with the right privileges to use the port 162?

Sorry for late reply @pierhugues

Yes everytime i got this error
I got this when i starting it there is no events
Yes I use right privileges