Discussion:
How do i log the DEBUGMSGTL statements to a file ??
v***@wipro.com
2007-03-07 12:18:46 UTC
Permalink
Hi,

I am using net-snmp-5.3.0.1. Am trying to log the DEBUGMSGTL statements
to a file. The man page of snmpd says that if we start the agent with -D
option, it will print all the statements to the console and using -Lf
option i can write it to a file.

I am starting the agent as follows
/usr/local/sbin/snmpd -c ./snmpd.conf -Lf /var/log/snmpd.log -D

But the only statement which i can see in the snmpd.log file is
NET-SNMP version 5.3.0.1.

Am i missing out anything?

Thanks and Regards,
Vikash Sharma
Dave Shield
2007-03-07 12:31:55 UTC
Permalink
Post by v***@wipro.com
I am starting the agent as follows
/usr/local/sbin/snmpd -c ./snmpd.conf -Lf /var/log/snmpd.log -D
Yup - that should work.
I've tried it with both the 5.3.x and main development lines.
Post by v***@wipro.com
But the only statement which i can see in the snmpd.log file is
NET-SNMP version 5.3.0.1.
What happens if you try logging to stderr:

/usr/local/sbin/snmpd -c ./snmpd.conf -f -Le -D

Do you see the debug output?

What about

/usr/local/sbin/snmpd -c ./snmpd.conf -f -Lf /var/log/snmpd.log -D

(i.e. don't detach from the terminal).
What do you see on stdout/stderr?
What do you see in the log file?

Try specifying a different logfile location. (e.g. /tmp/snmpd.log)


Dave
Dave Shield
2007-03-07 15:59:07 UTC
Permalink
[ First - *please* don't mail me privately, without copying
any responses to the mailing list. I don't have the time
or inclination to offer private, unpaid, SNMP consultancy.
Keep discussions to the list, where others can both learn
and offer advice. Thanks. ]
I tried the steps suggested by u.
1. /usr/local/sbin/snmpd -c ./snmpd.conf -f -Le -D
Output on stderr - "NET-SNMP version 5.3.0.1"
2. /usr/local/sbin/snmpd -c ./snmpd.conf -f -Lf
/var/log/snmpd.log -D
Content of /var/log/snmpd.log - "NET-SNMP version 5.3.0.1"
3. Try specifying a different logfile location. (e.g.
/tmp/snmpd.log)
Content of /tmp/snmpd.log - "NET-SNMP version 5.3.0.1"
Am unable to see any of the DEBUGMSGTL statements.
OK - so it looks as if debugging isn't available at all.
We have configured it as follows on Debian OS.
./configure --prefix=/usr --bindir=$(BINDIR) -sbindir=$(BINDIR)
--includedir=/usr/include --libdir=$(LIBDIR) --enable-shared
--disable-debugging .....
Ahem.
Have a think about that last option.
Do you perhaps think that this might possibly be relevant
to your problem?
..... --with-logfile="/var/log/snmpd.log"
--with-persistent-directory="/var/snmp" --enable-ipv6
-with-default-snmp-version="1" --with-out-mib-modules="host"
--with-transports="UDPIPv6 TCPIPv6 IPX" --with-sys-contact=""
--enable-ucd-snmp-compatibility --with-sys-location="" --silent
--with-defaults --host=mips-unknown-linux-gnu
Do we need to
configure the net-snmp with some debug options.
Yes.

If you want to use debugging, then it doesn't make much
sense to explicitly turn it off :-)

Dave

Loading...