# SNMP trap forwarding

**URL:** <https://www.ruby-forum.com/t/snmp-trap-forwarding/187018>\
**Category:** Ruby\
**Created:** [April 15, 2010, 9:24pm UTC](https://www.ruby-forum.com/t/snmp-trap-forwarding/187018 "2010-04-15T21:24:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![zampar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/898d66/32.png) [@zampar](https://www.ruby-forum.com/u/zampar)\
**Post date:** [April 15, 2010, 9:24pm UTC](https://www.ruby-forum.com/t/snmp-trap-forwarding/187018/1 "2010-04-15T21:24:13Z")

</div>

Hi,

## I want to listen the trap and send this trap to another plataform. At first time and search in web I try this:

require ‘snmp’

m = SNMP::TrapListener.new(:Host =\> ‘10.10.5.114’,:Port =\> 162,  
:Community =\> ‘public’,:MaxReceiveBytes =\> 18000) do |manager|  
manager.on\_trap\_default { |trap| p trap

SNMP::Manager.open(:Host =\> ‘10.10.5.56’,:TrapPort =\> 2017,:Version =\>  
:SNMPv1,:MaxReceiveBytes =\> 18000) do |snmp|  
snmp.trap\_v1(  
“enterprises.9”,  
“10.10.5.56”, #example I want put the trap data here  
:enterpriseSpecific,  
42,  
12345)  
#[VarBind.new(“1.3.6.1.2.3.4”, Integer.new(1))])  
end

```
                        }

```

## end m.join

My question is how to put the trap data listened to send snmp trap like  
a original trap. I try to search for examples in web but I don’t find a  
good example for this use.

Thanks in advance. Carlos.
