Re: Adding timestamp in snmpd.log

dga via Net-snmp-users <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
Hi,

I use following method:

Once snmpd is started, I launch following cmmand: snmpd -f 
-DnstAgentSubagentObject -Lf /tmp/snmp.log

Then you can see debug traces in /tmp/snmp.log

Bellow example of syntax to create a trace in the log file:

snmp_log(LOG_ERR, "Example of debug trace !\n");

Regards,

Damien GARCIA


Le 20/03/2020 à 08:02, Krishna Vivek Vitta a écrit :
>
> Hi Anders
>
> Is there a mechanism to enable/control log level ? What are the 
> options that I need to include in snmpd.conf ? I assume, the logging 
> level is debug(default) which prints all messages
>
> Thank you
>
> Krishna Vivek
>
> *From:*Anders Wallin <[email protected]>
> *Sent:* 02 December 2019 16:22
> *To:* Krishna Vivek Vitta <[email protected]>
> *Cc:* [email protected]
> *Subject:* Re: Adding timestamp in snmpd.log
>
> On Sun, Dec 1, 2019 at 4:38 AM Krishna Vivek Vitta 
> <[email protected] <mailto:[email protected]>> 
> wrote:
>
>     Thank you Anders for swift response.
>
>     "[snmp] logTimestamp 1"
>
>     What does [snmp] indicate in above line ? Is it compulsory ?
>
> Yes it's compulsory. This is an option that's not snmpd specific so 
> the "interpreter" used should point to the generic  "snmp interpreter"
>
>     Our application frequently alters the contents of snmpd.conf in
>     including trap destintions and managers. This may lead the entry
>     “logTimestamp 1” being missed out in snmpd.conf.
>
>     Can timestamp be logged automatically without including the above
>     option in snmpd.conf ?
>
> You can also place this on the command line, see the man page for 
> snmpd, e.g.
> snmpd --logTimestamp=1 .....
>
> (note, here you don't need the "[snmp]"
>
> If you want to set it by default you need to dig into the net-snmp 
> code....
>
>     Is there option as part of execution in snmpd or is there any
>     change that can be included in source code ?
>
>     Thank you
>
>     Krishna Vivek
>
>     *From:*Anders Wallin <[email protected] <mailto:[email protected]>>
>     *Sent:* 29 November 2019 20:34
>     *To:* Krishna Vivek Vitta <[email protected]
>     <mailto:[email protected]>>
>     *Cc:* [email protected]
>     <mailto:[email protected]>
>     *Subject:* Re: Adding timestamp in snmpd.log
>
>     add
>
>     "[snmp] logTimestamp 1"
>
>      in snmpd.conf
>
>     Regards
>
>     Anders Wallin
>
>     On Fri, Nov 29, 2019 at 3:57 PM Krishna Vivek Vitta
>     <[email protected]
>     <mailto:[email protected]>> wrote:
>
>         Hi team,
>
>         We have a snmpd agent running in a Freebsd box.
>
>         The following command is being used to run snmpd:
>
>         “Snmpd -c snmpd.conf -Lf snmpd.log -p snmpd.pid”
>
>         Is there any option to add timestamp being logged for every
>         trace in snmpd.log ? Kindly assist
>
>         Thank you
>
>         Krishna Vivek
>
>         _______________________________________________
>         Net-snmp-users mailing list
>         [email protected]
>         <mailto:[email protected]>
>         Please see the following page to unsubscribe or change other
>         options:
>         https://lists.sourceforge.net/lists/listinfo/net-snmp-users
>
>
>
> _______________________________________________
> Net-snmp-users mailing list
> [email protected]
> Please see the following page to unsubscribe or change other options:
> https://lists.sourceforge.net/lists/listinfo/net-snmp-users

_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.