Re: Duplicate entries in log file for snmptrapd

Alexander Shikoff <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
On Thu, Dec 18, 2008 at 01:29:21PM +0200, Alexander Shikoff wrote:
> Hello again,
> 
> one more problem with snmptrapd: it sends duplicates log entries to syslog:
> Dec 18 13:19:56 noc snmptrapd[90698]: NET-SNMP version 5.4.2.1
> Dec 18 13:20:37 noc snmptrapd[90698]: noc.itcons.net.ua [UDP: [0.0.0.0]->[193.108.130.2]:-5246]: Trap , DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (0) 0:00:00.00, SNMPv2-MIB::snmpTrapOID.0 = OID: IF-MIB::linkUp, IF-MIB::ifIndex.1 = INTEGER: 1, IF-MIB::ifAdminStatus.1 = INTEGER: up(1), IF-MIB::ifOperStatus.1 = INTEGER: up(1), IF-MIB::ifDescr = STRING: fxp0
> Dec 18 13:20:37 noc snmptrapd[90698]: noc.itcons.net.ua [UDP: [0.0.0.0]->[193.108.130.2]:-5246]: Trap , DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (0) 0:00:00.00, SNMPv2-MIB::snmpTrapOID.0 = OID: IF-MIB::linkUp, IF-MIB::ifIndex.1 = INTEGER: 1, IF-MIB::ifAdminStatus.1 = INTEGER: up(1), IF-MIB::ifOperStatus.1 = INTEGER: up(1), IF-MIB::ifDescr = STRING: fxp0
> Dec 18 13:21:51 noc snmptrapd[90698]: 2008-12-18 13:21:51 NET-SNMP version 5.4.2.1 Stopped.
> Dec 18 13:21:51 noc snmptrapd[90698]: 2008-12-18 13:21:51 NET-SNMP version 5.4.2.1 Stopped.
> Dec 18 13:21:51 noc snmptrapd[90698]: Stopping snmptrapd
> Dec 18 13:21:51 noc snmptrapd[90698]: Stopping snmptrapd
> Dec 18 13:22:02 noc snmptrapd[90812]: NET-SNMP version 5.4.2.1
> Dec 18 13:22:02 noc snmptrapd[90812]: NET-SNMP version 5.4.2.1
> 
> Is there a way to fix it? Thanks.

The problem is still actual. Fresh installation of net-snmp on FreeBSD 8.0:
all traps and system messages are logged twice if logOption sd is present
in configuration file:

# /usr/local/etc/rc.d/snmptrapd start
Starting snmptrapd.

# /usr/local/etc/rc.d/snmptrapd stop
Stopping snmptrapd.
Waiting for PIDS: 55151.

# tail /var/log/snmp/traps.log
Dec  3 12:54:54 mars snmptrapd[55151]: NET-SNMP version 5.4.2.1
Dec  3 12:54:54 mars snmptrapd[55151]: NET-SNMP version 5.4.2.1
Dec  3 12:55:38 mars snmptrapd[55151]: 2009-12-03 12:55:38 NET-SNMP version 5.4.2.1 Stopped.
Dec  3 12:55:38 mars snmptrapd[55151]: 2009-12-03 12:55:38 NET-SNMP version 5.4.2.1 Stopped.
Dec  3 12:55:38 mars snmptrapd[55151]: Stopping snmptrapd
Dec  3 12:55:38 mars snmptrapd[55151]: Stopping snmptrapd

Configuration files are /usr/local/etc/snmp/snmptrapd.conf:

# cat /usr/local/etc/snmp/snmptrapd.conf 
snmpTrapdAddr                   193.200.84.8
doNotRetainNotificationLogs     yes
authCommunity                   log,execute UOsTrapPer01
logOption sd

If logOption is commented then all messages are logged only once.
Is it a bug or feature?

-- 
MINO-RIPE

------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
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.