# Snmptrap input

**URL:** https://discuss.elastic.co/t/snmptrap-input/51578
**Category:** Logstash
**Created:** [June 1, 2016, 3:12pm UTC](https://discuss.elastic.co/t/snmptrap-input/51578 "2016-06-01T15:12:54Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Virkel](https://avatars.discourse-cdn.com/v4/letter/v/ecb155/32.png) [@Virkel](https://discuss.elastic.co/u/Virkel)
#### Post date: [June 1, 2016, 3:12pm UTC](https://discuss.elastic.co/t/snmptrap-input/51578/1 "2016-06-01T15:12:54Z")

</div>

Hello,

I am currently attempting to configure snmptrap input for my elk server on a VM, I'm new to elk and only been working with it for about two weeks now. My configuration is below:

input {  
snmptrap {  
port =\> 162  
type =\> "snmptrap"  
community =\> "public"  
#yamlmibdir =\> "/opt/logstash/vendor/bundle/jruby/1.9/gems/snmp-1.2.0/data/ruby/snmp/mibs"

}  
syslog {  
port =\> 516  
type =\> "syslog"  
tags =\> ["syslog"]  
}  
}

filter {

}

output {  
stdout {}  
elasticsearch {hosts =\> ["localhost:9200"]}  
}

_Ends the config file_

When I send snmp traffic my machine recieves it but then out puts the error below in the /var/log/logstash/logstash.stdout file

 ![](https://us1.discourse-cdn.com/elastic/original/2X/e/e49224c87c829554e13bdaa8aeb4fe156da3a084.JPG)

Does anyone know how to fix this error message I can't find anything online about it.

---

<div class="post-metadata">

### Author: ![Jeremy\_Falling](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jeremy_falling/32/504_2.png) [@Jeremy\_Falling](https://discuss.elastic.co/u/Jeremy_Falling)
#### Post date: [June 2, 2016, 9:50am UTC](https://discuss.elastic.co/t/snmptrap-input/51578/2 "2016-06-02T09:50:28Z")

</div>

Which version of logstash are you using?  
Also, are you testing this by using snmp traps from a device or are you generating them manually using a utility?

/Jeremy

---

<div class="post-metadata">

### Author: ![Virkel](https://avatars.discourse-cdn.com/v4/letter/v/ecb155/32.png) [@Virkel](https://discuss.elastic.co/u/Virkel)
#### Post date: [June 2, 2016, 12:15pm UTC](https://discuss.elastic.co/t/snmptrap-input/51578/3 "2016-06-02T12:15:24Z")

</div>

Hello Jeremy,

First allow me to say thank you very much for responding to my question. Here is my versions down below:

Logstash Version - 2.3.1 All Plugins (Tar Version)  
Elasticsearch Version - 2.3.3 (DEB Version)  
Kibana Version - 4.5.1 (DEB Version)

When I first tested the setup, I used netcat to generate 5 snmptrap packets from the host of my VM the first two packets were successful in populating in Kibana with correct information. The last 3 were not, after that I attempted to send snmptrap packets from a Cisco WLC 5500 Series none of these reached Kibana and all produced the "Error handling trap SNMP::BER::OUTOFDATA" messages I showed in my picture above. After that I searched on the internet and attempted to fix it by using  
"yamlmibdir =\> "/opt/logstash/vendor/bundle/jruby/1.9/gems/snmp-1.2.0/data/ruby/snmp/mibs" I still received the OUTOFDATA error message but I was receiving the "Warning Old Mibs are being overwritten message" that appeared in logstash err file. I also have a physical server set up now available for use if there is a known problem with doing this set up in VM's.

_End Goal_

My end goal with this is to be able to receive SNMPTRAP/Syslogs from around 11 WLC of different series and Syslogs from around 6 Cisco ISE devices and make that data easily manageable and comparable.

---

<div class="post-metadata">

### Author: ![jerrac](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jerrac/32/52980_2.png) [@jerrac](https://discuss.elastic.co/u/jerrac)
#### Post date: [June 7, 2016, 9:12pm UTC](https://discuss.elastic.co/t/snmptrap-input/51578/4 "2016-06-07T21:12:40Z")

</div>

Did you ever figure this out? I've been looking into something similar.

How did you send snmp info to logstash? I've been trying to test the snmptrap input, but I haven't figured out how to actually send data to it...

---

<div class="post-metadata">

### Author: ![Virkel](https://avatars.discourse-cdn.com/v4/letter/v/ecb155/32.png) [@Virkel](https://discuss.elastic.co/u/Virkel)
#### Post date: [June 7, 2016, 10:20pm UTC](https://discuss.elastic.co/t/snmptrap-input/51578/5 "2016-06-07T22:20:08Z")

</div>

Unfortunately no I have not figured it out fully. I found a work around I'll explain later.

In order to get information to my logstash I used the snmptrap plugin

input {  
snmptrap {  
port =\> 162  
type =\> "snmptrap"  
community =\> "public"

}}

filter {

}

output {  
stdout {}  
elasticsearch {hosts =\> ["localhost:9200"]}  
}

This was my set up to read the data although the plugin did not work. In order to get data to that port you ether need to specify the port in the the config by adding " port =\> 9700 " or you can run logstash as root since in linux the lower ports like 162 which is the default snmptrap port for Cisco devices are reserved for root.

So the two ways I sent data to logstash in order to test this input is but using a Cisco WLC and enabling and disabling and enabling it to create trap logs, or the second was using netcat to send udp packets to my system. "netcat -u host port" but this still did not fix my error.

I was able to successfully read in snmptrap data but using tcpdump to appended the data sent to port 162 to a file and then read that file in by using the file input in logstash and that worked successfully.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 6, 2017, 4:54am UTC](https://discuss.elastic.co/t/snmptrap-input/51578/6 "2017-07-06T04:54:18Z")

</div>


