Re: SNMPv3 trap configuration question

"Dave Shield" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
On 16/01/07, kevin lee <[email protected]> wrote:
> I am trying to configure device to generate snmpv3 traps.
> I use the trapsess directive to define the trap host, however I notice
> that the traps being sent out do not include authoritative engine ID,
> engine boots and engine time.


Which version of the agent are you using?
This problem has been addressed with the latest release (5.4),
and the fix has been included in the 5.3.x and 5.2.x branches,
ready for the next releases on those lines too.

The necessary code change is appended.

Dave

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

_______________________________________________
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
trap.diff (text/x-patch, 1.2 KB)
Index: agent/agent_trap.c
===================================================================
RCS file: /cvsroot/net-snmp/net-snmp/agent/agent_trap.c,v
retrieving revision 5.28
retrieving revision 5.29
diff -u -r5.28 -r5.29
--- agent/agent_trap.c	19 May 2006 18:31:50 -0000	5.28
+++ agent/agent_trap.c	12 Sep 2006 17:33:18 -0000	5.29
@@ -1153,6 +1153,7 @@
     char           *argv[MAX_ARGS], *cp = cptr, tmp[SPRINT_MAX_LEN];
     int             argn, arg;
     netsnmp_session session, *ss;
+    size_t          len;
 
     /*
      * inform or trap?  default to trap 
@@ -1182,6 +1183,18 @@
         return;
     }
 
+    /*
+     * If this is an SNMPv3 TRAP session, then the agent is
+     *   the authoritative engine, so set the engineID accordingly
+     */
+    if (ss->version == SNMP_VERSION_3 &&
+        traptype != SNMP_MSG_INFORM   &&
+        ss->securityEngineIDLen == 0) {
+            len = snmpv3_get_engineID( tmp, sizeof(tmp));
+            memdup(&ss->securityEngineID, tmp, len);
+            ss->securityEngineIDLen = len;
+    }
+
 #ifndef DISABLE_SNMPV1
     if (ss->version == SNMP_VERSION_1) {
         add_trap_session(ss, SNMP_MSG_TRAP, 0, SNMP_VERSION_1);
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.