# SNMP Configuration re. Net-SNMP to Enable STDERR



## rtwingfield (Nov 11, 2013)

I am developing a custom /usr/local/etc/snmp/snmpd.conf file, and (having _worked_ on it until  it doesn't work ), the snmpd will not start.  In the /etc/rc.conf file, I have the following code:
	
	



```
snmpd_enable="YES"
snmpd_flags="-D ALL"   # ...to show all debug tokens.
snmpd_conffile="[FILE]/usr/local/etc/snmp/snmpd.conf[/FILE]"
```

Executing the command to start the service, returns the following:

```
# [CMD]service snmpd start[/CMD]
Starting snmpd.
logging:register: registering log type 3 with pri 7
Log handling defined - disabling stderr
/usr/local/etc/rc.d/snmpd: WARNING: failed to start snmpd
```
Questions:

Where is _log handling_ defined?
How to enable stderr?


----------



## rtwingfield (Nov 11, 2013)

Well, my apologies... I didn't read SNMPCMD(1) re:

```
LOGGING OPTIONS
       The mechanism and destination to use for logging of warning  and
       error  messages  can be controlled by passing various parameters
       to the -L flag.

       -Le    Log messages to the standard error stream.
```
I added -Le to the flags
	
	



```
snmpd_flags="-D ALL -Le"
```
and now the info streams to stderr.

So now, I can see the following complaint (and _much_ more):


```
Error opening specified endpoint "udp:127.0.0.1:161"
Server Exiting with code 1
/usr/local/etc/rc.d/snmpd: WARNING: failed to start snmpd
```

Hope this helps someone else.


----------



## rtwingfield (Nov 11, 2013)

Once the problem has been solved, be sure to turn off the flags in /etc/rc.conf

```
[B]#[/B] snmpd_flags="-D all -Le" # ...to show all debug tokens, etc.
```
or the output will make you crazy.


----------

