The database name was hardcoded to net_snmp. This patch makes it
possible to configure it to use something else from the command line, or
from a my.cnf file.
---
 apps/snmptrapd_sql.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/apps/snmptrapd_sql.c b/apps/snmptrapd_sql.c
index 628c9bf..089422f 100644
--- a/apps/snmptrapd_sql.c
+++ b/apps/snmptrapd_sql.c
@@ -458,6 +458,8 @@ netsnmp_mysql_init(void)
             _sql.port_num = atoi(&not_argv[i][7]);
         else if (strncmp(not_argv[i],"--socket=",9) == 0)
             _sql.socket_name = &not_argv[i][9];
+        else if (strncmp(not_argv[i],"--database=",11) == 0)
+            _sql.db_name = &not_argv[i][11];
         else
             snmp_log(LOG_WARNING, "unknown argument[%d] %s\n", i, not_argv[i]);
     }
-- 
1.7.11.7


------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to