# net-snmp 5.7.1_7



## lifefornazgul (Sep 7, 2012)

Where is the configuration file for snmptrapd(8)?

I'm using net-snmp-5.7.1_7 and succesfully starting snmpd(8) and snmptrapd(8).

But there is only a config snmpd.conf, any snmptrapd.conf !

Why can not I find a file snmptrapd.conf referred in man?
In this case, where do I register my "traphandlers"?


----------



## SirDice (Sep 7, 2012)

If it doesn't exist, create it.


----------



## lifefornazgul (Sep 7, 2012)

mm.. perhaps there should be an example? Indeed, in all mans says that snmptrapd config file should be ... also point the way where it should be


----------



## walko (Sep 7, 2012)

I think it's /usr/local/share/snmp/snmpd.conf or snmpd.conf.example.


----------



## lifefornazgul (Sep 7, 2012)

Man said about the two different files 
	
	



```
snmpd.conf
```
 and 
	
	



```
snmptrapd.conf
```


----------



## SirDice (Sep 7, 2012)

Normally config files for ports are stored in /usr/local/etc/. But I think this port is a notable exception. Walko posted the correct directory. For snmptrapd.conf I'd try and see if creating it in the same directory as snmpd.conf works. 

If all else fails snmptrapd(8) has an option to set the config file. You can use snmptrapd_flags in /etc/rc.conf to set additional flags.


----------



## chatwizrd (Sep 7, 2012)

I would just use snmpconf to create the config.


----------



## SirDice (Sep 7, 2012)

Ha! Yes, now I remember. The example doesn't even work. It throws a couple of errors if I recall correctly. You really have to go through the script to generate a functional config. Once you have that you can put in the aforementioned directory.


----------



## lifefornazgul (Sep 8, 2012)

Yeah, when I started snmpconf (btw without any flags and args), I was offered a choice which configuration file to create

```
1. snmpd.conf
2.snmptrapd.conf
3.snmp.conf
```
Thanks for help, guys. Good luck )


----------

