I have some question about the code at the end of this function:
1.) Why is the send_trap_to_sess() called for each entry at sinks
without check the snmpNotifyFilter?
2.) And why is the snmpNotifyFilter called via callback 2 times (with
v1 and v2 trap pdu)?
3.) Why is the callback called too if the NETSNMP_DISABLE_SNMPV1 is set?
4.) The standard traps like coldStart is not right logged in this way
if send as v1 trap only, how can this fixed?
The background to my questions is the following scenario:
I have configured 3 trap receiver:
1 trapsink
1 trap2sink
1 informsink
Than each trap is send 3 times and logged 2 times at the nlmLogTable.
That seems for me to be wrong!
It would be nice to get an answer,
Claus
##########################
int
netsnmp_send_traps(int trap, int specific,
const oid * enterprise, int enterprise_length,
netsnmp_variable_list * vars,
const char * context, int flags)
{
// ... skip
/*
* Now loop through the list of trap sinks
* and call the trap callback routines,
* providing an appropriately formatted PDU in each case
*/
for (sink = sinks; sink; sink = sink->next) {
#ifndef NETSNMP_DISABLE_SNMPV1
if (sink->version == SNMP_VERSION_1) {
if (template_v1pdu) {
send_trap_to_sess(sink->sesp, template_v1pdu); // FIXME:
without filter and no log? ck
}
} else {
#endif
if (template_v2pdu) {
template_v2pdu->command = sink->pdutype; // FIXME: the
last loop value will be seen by callbacks! ck
send_trap_to_sess(sink->sesp, template_v2pdu);
}
#ifndef NETSNMP_DISABLE_SNMPV1
}
#endif
}
if (template_v1pdu)
snmp_call_callbacks(SNMP_CALLBACK_APPLICATION,
SNMPD_CALLBACK_SEND_TRAP1, template_v1pdu);
if (template_v2pdu)
snmp_call_callbacks(SNMP_CALLBACK_APPLICATION,
SNMPD_CALLBACK_SEND_TRAP2, template_v2pdu);
snmp_free_pdu(template_v1pdu);
snmp_free_pdu(template_v2pdu);
return 0;
}
On 19.10.2010, at 23:24, Claus Klein wrote:
Hallo experts,
What is the status of the notification log mib?
The README.agent-mibs is not clear about this mib.
I found that the nlmLogTable and the nlmLogVariableTable is only
partly filled for V1 traps.
I opened a BUG tracker for this, but there is no response?
claus-kleins-macbook-pro:tmp clausklein$ diff -u snmp-test-
T058agentauthtrap1_simple-71*/output*-2
--- snmp-test-T058agentauthtrap1_simple-71406/output-
simple_run71406-2
2010-10-18 21:39:07.000000000 +0200
+++ snmp-test-T058agentauthtrap1_simple-71637/output-
simple_run71637-2
2010-10-18 21:41:09.000000000 +0200
@@ -1,15 +1,29 @@
-RUNNING: snmpwalk -r 0 -t 5 -v 1 -c testcommunity udp:127.0.0.1:8834
NOTIFICATION-LOG-MIB::notificationLogMIB
+RUNNING: snmpwalk -r 0 -t 5 -v 1 -c testcommunity udp:127.0.0.1:8852
NOTIFICATION-LOG-MIB::notificationLogMIB
NOTIFICATION-LOG-MIB::nlmConfigGlobalEntryLimit.0 = Gauge32: 1000
NOTIFICATION-LOG-MIB::nlmConfigGlobalAgeOut.0 = Gauge32: 1440 minutes
NOTIFICATION-LOG-MIB::nlmStatsGlobalNotificationsLogged.0 =
Counter32: 2 notifications
NOTIFICATION-LOG-MIB::nlmStatsGlobalNotificationsBumped.0 =
Counter32: 0 notifications
NOTIFICATION-LOG-MIB::nlmLogTime."default".1 = Timeticks: (2)
0:00:00.02
-NOTIFICATION-LOG-MIB::nlmLogTime."default".2 = Timeticks: (9)
0:00:00.09
-NOTIFICATION-LOG-MIB::nlmLogDateAndTime."default".1 = STRING:
2010-10-18,21:39:2.0,-2:0
-NOTIFICATION-LOG-MIB::nlmLogDateAndTime."default".2 = STRING:
2010-10-18,21:39:2.0,-2:0
+NOTIFICATION-LOG-MIB::nlmLogTime."default".2 = Timeticks: (10)
0:00:00.10
+NOTIFICATION-LOG-MIB::nlmLogDateAndTime."default".1 = STRING:
2010-10-18,21:41:4.0,-2:0
+NOTIFICATION-LOG-MIB::nlmLogDateAndTime."default".2 = STRING:
2010-10-18,21:41:4.0,-2:0
NOTIFICATION-LOG-MIB::nlmLogEngineID."default".1 = ""
NOTIFICATION-LOG-MIB::nlmLogEngineID."default".2 = ""
NOTIFICATION-LOG-MIB::nlmLogContextEngineID."default".1 = ""
NOTIFICATION-LOG-MIB::nlmLogContextEngineID."default".2 = ""
NOTIFICATION-LOG-MIB::nlmLogContextName."default".1 = STRING:
NOTIFICATION-LOG-MIB::nlmLogContextName."default".2 = STRING:
+NOTIFICATION-LOG-MIB::nlmLogNotificationID."default".1 = OID: SNMPv2-
MIB::coldStart
+NOTIFICATION-LOG-MIB::nlmLogNotificationID."default".2 = OID: SNMPv2-
MIB::authenticationFailure
+NOTIFICATION-LOG-MIB::nlmLogVariableID."default".1.1 = OID: SNMPv2-
MIB::sysUpTime.0
+NOTIFICATION-LOG-MIB::nlmLogVariableID."default".1.2 = OID: SNMPv2-
MIB::snmpTrapEnterprise.0
+NOTIFICATION-LOG-MIB::nlmLogVariableID."default".2.1 = OID: SNMPv2-
MIB::sysUpTime.0
+NOTIFICATION-LOG-MIB::nlmLogVariableID."default".2.2 = OID: SNMPv2-
MIB::snmpTrapEnterprise.0
+NOTIFICATION-LOG-MIB::nlmLogVariableValueType."default".1.1 =
INTEGER: timeTicks(3)
+NOTIFICATION-LOG-MIB::nlmLogVariableValueType."default".1.2 =
INTEGER: objectId(7)
+NOTIFICATION-LOG-MIB::nlmLogVariableValueType."default".2.1 =
INTEGER: timeTicks(3)
+NOTIFICATION-LOG-MIB::nlmLogVariableValueType."default".2.2 =
INTEGER: objectId(7)
+NOTIFICATION-LOG-MIB::nlmLogVariableTimeTicksVal."default".1.1 =
Timeticks: (2) 0:00:00.02
+NOTIFICATION-LOG-MIB::nlmLogVariableTimeTicksVal."default".2.1 =
Timeticks: (10) 0:00:00.10
+NOTIFICATION-LOG-MIB::nlmLogVariableOidVal."default".1.2 = OID:
SNMPv2-SMI::enterprises.8072.3.2.255
+NOTIFICATION-LOG-MIB::nlmLogVariableOidVal."default".2.2 = OID:
SNMPv2-SMI::enterprises.8072.3.2.255
claus-kleins-macbook-pro:tmp clausklein$ diff -u snmp-test-
T058agentauthtrap1_simple-71*/snmpd.conf
--- snmp-test-T058agentauthtrap1_simple-71406/snmpd.conf 2010-10-18
21:39:02.000000000 +0200
+++ snmp-test-T058agentauthtrap1_simple-71637/snmpd.conf 2010-10-18
21:41:04.000000000 +0200
@@ -1,8 +1,8 @@
-[snmp] persistentdir /tmp/snmp-test-T058agentauthtrap1_simple-71406/
persist
+[snmp] persistentdir /tmp/snmp-test-T058agentauthtrap1_simple-71637/
persist
smuxsocket 1.0.0.0
com2sec testcommunitysec default testcommunity
group testcommunitygroup v1 testcommunitysec
view all included .1 80
access testcommunitygroup "" any noauth exact all none none
-trapsink udp:127.0.0.1:5694 public
+trap2sink udp:127.0.0.1:5712 public <<<<<<<<<<<<<<
authtrapenable 1
claus-kleins-macbook-pro:tmp clausklein$
The different is the v1/v2c trap configuration!
Is this a BUG or not?
Claus
On 17.10.2010, at 22:41, Claus Klein wrote:
Hello
I'm working with net-snmp 5.6 and I checked all with the
notification-
log-mib.
How can it be that the nlmLogNotificationID is missing while walk?
I can see the initialisation and the adding of a trap at the logfile,
but the nlmlogVariableTable and tha nlmLogNotificationID is always
missing while walk:
snmpwalk -r 0 -t 5 -v 3 -u unsec -l noAuthNoPriv -n snmptrapd udp:127.0.0.1:8767
NOTIFICATION-LOG-MIB::notificationLogMIB
NOTIFICATION-LOG-MIB::nlmConfigGlobalEntryLimit.0 = Gauge32: 1000
NOTIFICATION-LOG-MIB::nlmConfigGlobalAgeOut.0 = Gauge32: 1440 minutes
NOTIFICATION-LOG-MIB::nlmStatsGlobalNotificationsLogged.0 =
Counter32:
1 notifications
NOTIFICATION-LOG-MIB::nlmStatsGlobalNotificationsBumped.0 =
Counter32:
0 notifications
NOTIFICATION-LOG-MIB::nlmLogTime."default".1 = Timeticks: (22)
0:00:00.22
NOTIFICATION-LOG-MIB::nlmLogDateAndTime."default".1 = STRING:
2010-10-17,21:10:34.0,-2:0
NOTIFICATION-LOG-MIB::nlmLogEngineID."default".1 = ""
NOTIFICATION-LOG-MIB::nlmLogEngineTAddress."default".1 = Hex-STRING:
01 00 00 7F EB C3
NOTIFICATION-LOG-MIB::nlmLogEngineTDomain."default".1 = OID: SNMPv2-
TM::snmpUDPDomain
NOTIFICATION-LOG-MIB::nlmLogContextEngineID."default".1 = ""
NOTIFICATION-LOG-MIB::nlmLogContextName."default".1 = STRING:
notification_log: registering with '(null)' context
initialize_table_nlmLogVariableTable: adding index nlmLogName of type
ASN_OCTET_STR to table nlmLogVariableTable
initialize_table_nlmLogVariableTable: adding index nlmLogIndex of
type
ASN_UNSIGNED to table nlmLogVariableTable
initialize_table_nlmLogVariableTable: adding index
nlmLogVariableIndex
of type ASN_UNSIGNED to table nlmLogVariableTable
initialize_table_nlmLogVariableTable: adding column
nlmLogVariableIndex (#1) of type ASN_UNSIGNED to table
nlmLogVariableTable
initialize_table_nlmLogVariableTable: adding column nlmLogVariableID
(#2) of type ASN_OBJECT_ID to table nlmLogVariableTable
initialize_table_nlmLogVariableTable: adding column
nlmLogVariableValueType (#3) of type ASN_INTEGER to table
nlmLogVariableTable
initialize_table_nlmLogVariableTable: adding column
nlmLogVariableCounter32Val (#4) of type ASN_COUNTER to table
nlmLogVariableTable
initialize_table_nlmLogVariableTable: adding column
nlmLogVariableUnsigned32Val (#5) of type ASN_UNSIGNED to table
nlmLogVariableTable
initialize_table_nlmLogVariableTable: adding column
nlmLogVariableTimeTicksVal (#6) of type ASN_TIMETICKS to table
nlmLogVariableTable
initialize_table_nlmLogVariableTable: adding column
nlmLogVariableInteger32Val (#7) of type ASN_INTEGER to table
nlmLogVariableTable
initialize_table_nlmLogVariableTable: adding column
nlmLogVariableOctetStringVal (#8) of type ASN_OCTET_STR to table
nlmLogVariableTable
initialize_table_nlmLogVariableTable: adding column
nlmLogVariableIpAddressVal (#9) of type ASN_IPADDRESS to table
nlmLogVariableTable
initialize_table_nlmLogVariableTable: adding column
nlmLogVariableOidVal (#10) of type ASN_OBJECT_ID to table
nlmLogVariableTable
initialize_table_nlmLogVariableTable: adding column
nlmLogVariableCounter64Val (#11) of type ASN_COUNTER64 to table
nlmLogVariableTable
initialize_table_nlmLogVariableTable: adding column
nlmLogVariableOpaqueVal (#12) of type ASN_OPAQUE to table
nlmLogVariableTable
initialize_table_nlmLogTable: adding index nlmLogName of type
ASN_OCTET_STR to table nlmLogTable
initialize_table_nlmLogTable: adding index nlmLogIndex of type
ASN_UNSIGNED to table nlmLogTable
initialize_table_nlmLogTable: adding column nlmLogTime (#2) of type
ASN_TIMETICKS to table nlmLogTable
initialize_table_nlmLogTable: adding column nlmLogDateAndTime (#3) of
type ASN_OCTET_STR to table nlmLogTable
initialize_table_nlmLogTable: adding column nlmLogEngineID (#4) of
type ASN_OCTET_STR to table nlmLogTable
initialize_table_nlmLogTable: adding column nlmLogEngineTAddress (#5)
of type ASN_OCTET_STR to table nlmLogTable
initialize_table_nlmLogTable: adding column nlmLogEngineTDomain (#6)
of type ASN_OBJECT_ID to table nlmLogTable
initialize_table_nlmLogTable: adding column nlmLogContextEngineID
(#7)
of type ASN_OCTET_STR to table nlmLogTable
initialize_table_nlmLogTable: adding column nlmLogContextName (#8) of
type ASN_OCTET_STR to table nlmLogTable
initialize_table_nlmLogTable: adding column nlmLogNotificationID (#9)
of type ASN_OBJECT_ID to table nlmLogTable
...
netsnmp_udp: send 96 bytes from 0x808ba0 to UDP: [127.0.0.1]:162-
[0.0.0.0]:0 on fd 6
notification_log: logging something
notification_log: adding a row to the variables table
notification_log: adding a row to the variables table
notification_log: logged notifications 1; max 1000
notification_log: done logging something
NET-SNMP version 5.6
Do someone work with snmptrapd or with notificationLogMib enabled on
snmpd?
Regards,
Claus
------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
Flex(R) Builder(TM)) enable the development of rich applications
that run
across multiple browsers and platforms. Download your free trials
today!
http://p.sf.net/sfu/adobe-dev2dev_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders