[AGENT++] Question on sending snmp V3 traps/informs after restart.

Jochen Katz katz at agentpp.com
Tue Oct 20 22:02:06 CEST 2015


Hi,

> I am using agent++-4.0.2, and I would like to know whether the issue
> mentioned in the following link -
> http://oosnmp.net/pipermail/agentpp/2008-April/004276.html
> on sending "snmpV3" traps/informs after restart is fixed? If so, could any
> one please share the appropriate fix done.

this has been fixed with the two commits below.

Regards,
  Jochen


--- v3_mib.h	(Revision 517)
+++ v3_mib.h	(Revision 518)
@@ -170,8 +170,18 @@
  *
  * Users that are added to the table through SNMP are automatically
  * added to the USM. Also, users that are removed from the table are
- * removed from USM.
+ * removed from USM. If the USM creates new localized users after an
+ * engine id discovery, these entries are automatically added to this
+ * table with storage type volatile.
  *
+ * When adding rows using the addNewRow() function that takes passwords,
+ * The passwords are passed to the USM class, so engine id discovery
+ * will work. As this table does not hold the passwords itself, when
+ * writing persistent entries to file, the passwords cannot be stored.
+ * Therefore after loading the rows from file, engine id discvery
+ * will not work. If engine id discovery is needed, the snmp++
+ * USM::save_users() and USM::load_users() have to be used.
+ *
  * The difference between user name and security name is documented in
  * the USM class.
  */


--- v3_mib.cpp	(Revision 516)
+++ v3_mib.cpp	(Revision 517)
@@ -549,7 +549,7 @@
 void UsmUserTable::initialize_key_change(MibTableRow* row)
 {
   Oidx o;
-  row->get_nth(4)->get_value(o);
+  row->get_nth(4)->get_value(o); // oid auth protocol

   UsmKeyChange *ukc5 = (UsmKeyChange*)row->get_nth(5);
   UsmKeyChange *ukc6 = (UsmKeyChange*)row->get_nth(6);
@@ -585,16 +585,16 @@
     ukc6->initialize(hashlength, auth_prot, AUTHKEY, ukc5);

     Oidx op;
-    row->get_nth(7)->get_value(op);
+    row->get_nth(7)->get_value(op); // oid priv protocol
     if ((op == oidUsmNoPrivProtocol) ||
-	(auth_base.len() + 1 != o.len()) ||
-	(!auth_base.is_root_of(o)))
+	(priv_base.len() + 1 != op.len()) ||
+	(!priv_base.is_root_of(op)))
     {
 	//noop
     }
     else
     {
-	unsigned long priv_prot = o.last();
+	unsigned long priv_prot = op.last();

 	Priv *priv = usm->get_auth_priv()->get_priv(priv_prot);
 	int hashlength = 0;



More information about the AGENTPP mailing list