System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

configure net-snmptrapd to forward traps to another snmptrapd on same host

 
dhanuja
Occasional Contributor

configure net-snmptrapd to forward traps to another snmptrapd on same host

Hi

 

i have installed net-snmptrapd 5.8.dev and tried receiving traps from known hosts using below command and i can see traps are receiving

 

./snmptrapd -Lf logfile.log -c ../etc/snmp/snmptrapd.conf -C

 

my snmptrapd.conf file contains below parameters only

 

authCommunity log test123
pidFile /tmp/snmptrapd_test_pid.pid

 

 

now i need to improve my configuration file to have other parameters where below things to get done

 

a. receive traps from specified(known) hosts only

b. forward received traps to a different port in the same host ( there is another snmptrapd listning to this port to receive the traps)

 

i've tried including other parameters (like logoption,snmpTrapdAddr,etc) and is not success due to below error.

 

Warning: Unknown token: logOption

 

Can you please help to understand what parameters to be configured and how on achiving above requirements.

 

what i am trying to do is allow snmptrapd to listen on port 162 and forward them to other port (may be 1620).

 

thanks

 

dhanuja

2 REPLIES
Matti_Kurkela
Honored Contributor

Re: configure net-snmptrapd to forward traps to another snmptrapd on same host

First, if you want to forward any traps to another snmptrapd, you must add the "net" keyword on the authCommunity line(s), for example:

authCommunity log,net test123

 

To receive from specific hosts/networks only, append a source IP to the authCommunity line. You can use more than one authCommunity line:

authCommunity log,net test123 1.2.3.4 # receives from host 1.2.3.4
authCommunity log,net test123 2.3.4.5 # receives from host 2.3.4.5

# receive from 3.4.5.0 .. 3.4.5.255:
authCommunity log,net test123 3.4.5.0/24 

 To forward the received traps to a different port on the same host, you'll need to add another line:

forward default localhost:1620

 

MK
dhanuja
Occasional Contributor

Re: configure net-snmptrapd to forward traps to another snmptrapd on same host

Great and many thanks, suggested config params was working for me.