SNMP Configuration re. Net-SNMP to Enable STDERR

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:
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:
Code:
# [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?
 
Well, my apologies... I didn't read SNMPCMD(1) re:
Code:
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
Code:
snmpd_flags="-D ALL -Le"
and now the info streams to stderr.

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

Code:
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.
 
Once the problem has been solved, be sure to turn off the flags in /etc/rc.conf
Code:
[B]#[/B] snmpd_flags="-D all -Le" # ...to show all debug tokens, etc.
or the output will make you crazy. :P
 
Back
Top