# Listen to udp and parse the snmp in it

**URL:** <https://discourse.nodered.org/t/listen-to-udp-and-parse-the-snmp-in-it/8481>\
**Category:** General\
**Created:** [28 February 2019 17:22 UTC](https://discourse.nodered.org/t/listen-to-udp-and-parse-the-snmp-in-it/8481 "2019-02-28T17:22:48Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![Albin](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@Albin](https://discourse.nodered.org/u/Albin)\
**Post date:** [28 February 2019 17:22 UTC](https://discourse.nodered.org/t/listen-to-udp-and-parse-the-snmp-in-it/8481/1 "2019-02-28T17:22:48Z")

</div>

Hello guys,  
New to Node-red.  
I have a use case to 'Keep running a node to listen to UDP msgs and parse the snmp data in it and then it needs to be forwarded to kafka.  
Has anyone done something similar.  
Could you please help.

Note: New to networking..snmp,udp etc are kinda new to me.

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [28 February 2019 18:34 UTC](https://discourse.nodered.org/t/listen-to-udp-and-parse-the-snmp-in-it/8481/2 "2019-02-28T18:34:03Z")

</div>

What have you tried?  
The purpose of the forum is to help people learn. To do this its useful to understand what have have done and where you are stuck.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [28 February 2019 18:34 UTC](https://discourse.nodered.org/t/listen-to-udp-and-parse-the-snmp-in-it/8481/3 "2019-02-28T18:34:45Z")

</div>

There is an SNMP node if that helps. Otherwise, I suggest you output to debug and post an example here, someone will be able to help for sure.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [28 February 2019 18:36 UTC](https://discourse.nodered.org/t/listen-to-udp-and-parse-the-snmp-in-it/8481/4 "2019-02-28T18:36:19Z")

</div>

Link for the snmp node - [https://flows.nodered.org/node/node-red-node-snmp](https://flows.nodered.org/node/node-red-node-snmp)

---

<div class="post-metadata">

**Author:** ![Albin](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@Albin](https://discourse.nodered.org/u/Albin)\
**Post date:** [2 March 2019 13:16 UTC](https://discourse.nodered.org/t/listen-to-udp-and-parse-the-snmp-in-it/8481/5 "2019-03-02T13:16:06Z")

</div>

Hey @ukmoose ,

I made a flow which listens to my udp port 162 on my localhost ,to which I try to send a test trap using the snmpTrapgen.exe utility.(SnmpTrapGen.exe -r:localhost -q -v:2c -p:162 -to:.1.3.6.1.2.1.1.1.0)

Though I could see a response from the debug attached to the udp node the snmp node always returns the 'timeOut error'

 ![snmp_sample](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/f/f7f3b6b0dd1f83950ddd3d2968e806088d537796.png)  
PFB the json of the flow :-

```auto
[{"id":"7cc0cdb3.77520c","type":"tab","label":"Flow 5","disabled":false,"info":""},{"id":"31bedf90.29b91","type":"udp in","z":"7cc0cdb3.77520c","name":"","iface":"","port":"162","ipv":"udp4","multicast":"false","group":"","datatype":"base64","x":160,"y":80,"wires":[["a0115c69.220c1","11519d27.05ac3b"]]},{"id":"a0115c69.220c1","type":"debug","z":"7cc0cdb3.77520c","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":470,"y":80,"wires":[]},{"id":"11519d27.05ac3b","type":"snmp","z":"7cc0cdb3.77520c","host":"127.0.0.1:162","community":"public","version":"2c","oids":"1.3.6.1.2.1.1.1.0","timeout":5,"name":"","x":320,"y":240,"wires":[["7b01d0bd.e9ff2"]]},{"id":"7b01d0bd.e9ff2","type":"debug","z":"7cc0cdb3.77520c","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":560,"y":240,"wires":[]}]

```

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [2 March 2019 13:54 UTC](https://discourse.nodered.org/t/listen-to-udp-and-parse-the-snmp-in-it/8481/6 "2019-03-02T13:54:31Z")

</div>

Please see the post on how to share your flow, it is not importable as you have done it. You can edit your previous post accordingly.

> [@How to share code or flow json](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506):
>
> To share code samples or flow json in this forum, you need to take care to format it properly so that it is displayed correctly. The easiest way to do that is to click the 'Preformatted Text' button in the toolbar: [image] Then paste in your code or flow json. You should end up with three back-tick characters - ``` - on their own line before and after the code. On standard US English keyboards, this is on the same key as the ~ character. Using the backticks will ens…

---

<div class="post-metadata">

**Author:** ![Albin](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@Albin](https://discourse.nodered.org/u/Albin)\
**Post date:** [2 March 2019 15:03 UTC](https://discourse.nodered.org/t/listen-to-udp-and-parse-the-snmp-in-it/8481/7 "2019-03-02T15:03:23Z")

</div>

Thankyou @Colin

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [2 March 2019 15:23 UTC](https://discourse.nodered.org/t/listen-to-udp-and-parse-the-snmp-in-it/8481/8 "2019-03-02T15:23:46Z")

</div>

Ah right - you want to listen to snmp traps... I don't think the node does that right now. It can be used to get an oid, table etc from a device. Would need that adding I think.

---

<div class="post-metadata">

**Author:** ![Albin](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@Albin](https://discourse.nodered.org/u/Albin)\
**Post date:** [2 March 2019 15:38 UTC](https://discourse.nodered.org/t/listen-to-udp-and-parse-the-snmp-in-it/8481/9 "2019-03-02T15:38:05Z")

</div>

Thankyou @dceejay,  
Is there any other way to get my use case done!!!

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [2 March 2019 15:53 UTC](https://discourse.nodered.org/t/listen-to-udp-and-parse-the-snmp-in-it/8481/10 "2019-03-02T15:53:44Z")

</div>

This one may be more suitable :-)...

> **[node-red-contrib-snmp-trap-listener](https://www.npmjs.com/package/node-red-contrib-snmp-trap-listener)**
>
> Node-RED node that receives snmp traps.

apologies for not spotting that in the first place  
(always worth searching on [http://flows.nodered.org](http://flows.nodered.org) ...)

---

<div class="post-metadata">

**Author:** ![Albin](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@Albin](https://discourse.nodered.org/u/Albin)\
**Post date:** [5 March 2019 07:41 UTC](https://discourse.nodered.org/t/listen-to-udp-and-parse-the-snmp-in-it/8481/11 "2019-03-05T07:41:03Z")

</div>

![snmp_not_found](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/b/bc22804a4dc90db83f5d35d30cf38ac29ef993bf.png)

Thanks @dceejay ,  
But I could not find the installation of this particular node , the npm install also returned an error 🙄

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [5 March 2019 07:54 UTC](https://discourse.nodered.org/t/listen-to-udp-and-parse-the-snmp-in-it/8481/12 "2019-03-05T07:54:46Z")

</div>

So what error did the npm install return?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [5 March 2019 08:29 UTC](https://discourse.nodered.org/t/listen-to-udp-and-parse-the-snmp-in-it/8481/13 "2019-03-05T08:29:37Z")

</div>

Interestingly it appears the node can be installed using npm command line

```auto
cd .node-red
npm install node-red-contrib-snmp-trap-listener

```

but is not available for install via the palette manager.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [5 March 2019 08:35 UTC](https://discourse.nodered.org/t/listen-to-udp-and-parse-the-snmp-in-it/8481/14 "2019-03-05T08:35:34Z")

</div>

Ah - they haven't added a keywords section to the package.json

[https://nodered.org/docs/creating-nodes/packaging#package.json](https://nodered.org/docs/creating-nodes/packaging#package.json)

If someone would like to raise an issue that would be great.

---

<div class="post-metadata">

**Author:** ![Albin](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@Albin](https://discourse.nodered.org/u/Albin)\
**Post date:** [5 March 2019 09:14 UTC](https://discourse.nodered.org/t/listen-to-udp-and-parse-the-snmp-in-it/8481/15 "2019-03-05T09:14:23Z")

</div>

hello @ukmoose , I got the following error .

```auto
C:\Users\....\.....\.....\npm\node_modules\node-red>npm install node-red-contrib-snmp-trap-listener
npm ERR! code E404
npm ERR! 404 Not Found: node-red-contrib-snmp-trap-listener@latest

npm ERR! A complete log of this run can be found in: 

```

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [5 March 2019 09:16 UTC](https://discourse.nodered.org/t/listen-to-udp-and-parse-the-snmp-in-it/8481/16 "2019-03-05T09:16:12Z")

</div>

Are you sure you are installing it in the correct directory?

What does the complete log say? It looks like it can't find the file, but @Colin comment suggests that it is available

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [5 March 2019 09:37 UTC](https://discourse.nodered.org/t/listen-to-udp-and-parse-the-snmp-in-it/8481/17 "2019-03-05T09:37:51Z")

</div>

> [@Albin](#):
>
> C:\Users..............\npm\node\_modules\node-red\>npm install node-red-contrib-snmp-trap-listener

You should be running it from the same folder as your flows are located, usually this is the .node-red folder
