Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Regarding logOption in snmptrapd.conf file

2,000 views
Skip to first unread message

Dave Shield

unread,
Jan 7, 2013, 3:50:16 AM1/7/13
to
[ 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. ]

On 7 January 2013 05:45, Adishesh M <adish...@gmail.com> wrote:
> Hi Dave,
>
> I am using below net-snmp version.
> net-snmp-utils-5.5-41.el6.x86_64
> net-snmp-libs-5.5-41.el6.x86_64
> net-snmp-libs-5.5-41.el6.i686
> net-snmp-5.5-41.el6.x86_64
> net-snmp-perl-5.5-41.el6.x86_64
>
> command line option -Lf /tmp/all_traps is working.
>
>
> is there any way to do it in snmptrapd.conf file.

Probably not - no.

The 5.5 line still processes the logOptions token
at a relatively late stage - i.e. after the logging has
already been activated.


> i dont want to
> change the /etc/init.d/snmptrapd file which i am using for starting
> snmptrapd service.

Given your setup and requirements, I'm not sure you have a choice.

Either you upgrade to a new version of the software
(which is meant to have fixed the problem, though I'm not entirely convinced)
or you install a version compiled from source
(with a suitable tweak to the code)
or you configure this behavious via the service startup file
or you accept that the trap receiver will log via syslog as well as to
the specified logfile.

Your choice.

Dave

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122412
_______________________________________________
Net-snmp-users mailing list
Net-snm...@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Adishesh M

unread,
Jan 8, 2013, 3:16:18 AM1/8/13
to
Hi Dave,

Using latest version NET-SNMP Version: 5.7.2 same other error is coming.


snmptrapd is not recognizing logOption
Jan 8 13:35:17 mercury13 snmptrapd[8863]: /etc/snmp/snmptrapd.conf:
line 36: Warning: Unknown token: logOption.

it is still logging traps to /var/log/messages file.

my snmptrapd.conf file content is as given below and i am calling
snmptrapd using command '/usr/local/sbin/snmptrapd -C -c
/etc/snmp/snmptrapd.conf -Ot -On -OQ'
snmpTrapdAddr UDP:162
pidFile /var/run/snmptrapd.pid
logOption -f /tmp/all_traps
authCommunity log public

Thanks and regards,
Adishesh
Master SQL Server Development, Administration, T-SQL, SSAS, SSIS, SSRS
and more. Get SQL Server skills now (including 2012) with LearnDevNow -
200+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only - learn more at:
http://p.sf.net/sfu/learnmore_122512

Dave Shield

unread,
Jan 8, 2013, 3:23:46 AM1/8/13
to
On 8 January 2013 08:16, Adishesh M <adish...@gmail.com> wrote:
> Using latest version NET-SNMP Version: 5.7.2 same other error is coming.
>
> snmptrapd is not recognizing logOption

Please see my earlier message:


trying to set this {logOption} in the trapd config file is either not
processed early enough,
=***=> or needs to be marked with '[snmp]' <=***=
(and still doesn't seem to work properly)


> my snmptrapd.conf file content is as given below and i am calling


> snmpTrapdAddr UDP:162
> pidFile /var/run/snmptrapd.pid
> logOption -f /tmp/all_traps

This line needs to be given as

[snmp] logOption -f /tmp/all_traps


Recent changes have moved logOption from being an
application-level directive to a library one,
which means that it needs to be marked as such when
appearing in the application-specific config file.


But as I said above, I'm still not convinced that this is
working correctly.

mooli...@gmail.com

unread,
Nov 13, 2013, 9:34:57 AM11/13/13
to
[snmp] logOption -f /tmp/all_traps

Solved the issue for me, thanks.

Really could not have guessed this from the man pages though.

Thanks,
Mooli.

rameshcha...@gmail.com

unread,
May 7, 2015, 4:20:32 PM5/7/15
to
Hey ,

Can you send me your snmptrapd.conf file which use to capture logs in log file when snmp traps receives on the interface?

I am able to see traps when i run " snmptrapd -f -C -c snmptrapd.conf -Le "

Do we need run any specific command after reconfiguring .conf file?

what configuration i need to do so that whenever traps coming on interface they will log in to the file ?

I will really appreciate if you could answer to my question.
0 new messages