# net-snmp config issues - using masteragents and subagents

## randal1

Hi All!

I have tried the net-snmp mailing lists but they seem pretty dead so i figured I'd give you reliable gentoo'ers a go! 

My issue is this...

I have emerge net-snmp, and I want to set up a gentoo server running as the Master Agent, and another Gentoo Server running as the Sub Agent (so the Sub Agent forwards its SNMP Traps to the Master Agent, who in turn passes these on to the external server running snmptrapd).  I have attempted to test on a single Gentoo box, and have created the config and init scripts to start both services.  My configuration for each is as follows:

Master Configuration - 

```

master agentx

agentaddress 127.0.0.1 705

rocommunity  public

trap2sink 9.9.9.9

trapcommunity  public

authtrapenable  1

syslocation  mycluster

syscontact  email@me.com

```

and Slave Configuration -

```

rocommunity  public

trap2sink  127.0.0.1 705

trapcommunity  public

authtrapenable  1

syslocation  mycluster

syscontact  email@me.com

proc  apache  500

proc  qpsmgr 1

disk  / 2%

disk  /data/pgsql 2%

load  12 10 8

```

When I start the Master Agent, the logs show the following message...

 *Quote:*   

> 
> 
> Turning on AgentX master support.
> 
> NET-SNMP version 5.2.1.2
> ...

 

which looks good to me, next I start the Sub Agent and the following message appears...

 *Quote:*   

> 
> 
> /etc/snmp/snmpd.conf: line 31: Warning: Unknown token: trap2sink.
> 
> /etc/snmp/snmpd.conf: line 31: Warning: Unknown token: trap2sink.
> ...

 

It doesn't seem to like the trap2sink token in the configuration file, but I can't work out why   :Confused: 

If I look at the ports, it does seem to be connected though:

```

laptop ~ # netstat -an | grep 705

tcp        0      0 127.0.0.1:705           0.0.0.0:*               LISTEN

tcp        0      0 127.0.0.1:705           127.0.0.1:46098         ESTABLISHED

tcp        0      0 127.0.0.1:46098         127.0.0.1:705           ESTABLISHED

```

Please help, I'm lost as to how to solve this one!

Many thanks,

Aaron

----------

## dirac3000

I see it's been a long time since this has been posted, but I was wondering if anybody has any info about the correct way to setup a SNMPd server that actually sends traps (version 1 or 2 are fine, I don't need v3 so far).

I still have loads of troubles trying to understand how can I see a trap coming from my snmpd!

----------

## maruscya

Hello Guys !!

I'm starting now to work on snmptrapd. I have a lot of question about how snmptrap works...

But i not find any usefull information on web.... 

If you have some links ... please post it !!

----------

## Rainbow goblin

http://net-snmp.sourceforge.net/wiki/index.php/TUT:snmptrap#SNMP_Traps

----------

## Rainbow goblin

http://www.asmi.spb.ru/faq/snmp-traps-i/ In russian language

----------

## maruscya

 *Rainbow goblin wrote:*   

> http://net-snmp.sourceforge.net/wiki/index.php/TUT:snmptrap#SNMP_Traps

 

Many thanks !  :Smile: 

----------

