how to see the log of the DEBUGMSGTL in net-snmp

zhaojing picture zhaojing · Nov 9, 2011 · Viewed 7.7k times · Source

I am trying to write a snmp subagent that using agentX, which is supported by net-snmp. At first, I used the example codes from net-snmp FAQ:

http://www.net-snmp.org/wiki/index.php/TUT:Writing_a_Subagent

And from the example codes (example-demon.c,nstAgentSubagentObject.c,nstAgentSubagentObject.h), I build a subagent which can use agentX to perform snmpget and snmpset.

My question is: From the code in nstAgentSubagentObject.c, there are many trace codes such as follows:

DEBUGMSGTL(("nstAgentSubagentObject",
                "Initializing the nstAgentSubagentObject module\n"));

But I can't see the log anywhere.

I tried to start snmpd (demon of snmp) by snmpd -f -DnstAgentSubagentObject -Lf /tmp/snmp.log.

But I still can't see the log. Could anyone tell me how to see the log of DEBUGMSGTL?

Answer

Mapedd picture Mapedd · Feb 29, 2012

i can just set flag :

-Dverbose

or if you want to see all logs :

-Dall