snmptrapd doesn't log in mysql

1.3k views Asked by At

I am trying to log snmp traps to mysql db, but unfortunately without results. OS - Debian Net-SNMP v.5.7.3 MySQL 5.1 I am using snmptrapd and did the configuration from here

here is my snmptrapd.conf:

authCommunity log public
sqlMaxQueue 1
sqlSaveInterval 9

I did

./configure --with-defaults --with-mysql

as in the manual . Then

make
make install

Here is my ~/.my.cnf:

[snmptrapd]
user=snmp
password=******
host=localhost

my /default/snmpd:

#export MIBS=
#SNMPDRUN=yes    
#SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -g snmp -I -smux -p /var/run/snmpd.pid'    
TRAPDRUN=yes    
TRAPDOPTS='-Lsd -p /var/run/snmptrapd.pid'    
SNMPDCOMPAT=yes

I have exact DB schema as in the manual

I have success logging into syslog, but nothing in mysql. Even mysql log doesn't show anything. It's looks like snmptrapd doesnt reach MySQL

Can anyone give me idea what i am missing?

2

There are 2 answers

0
limberjack On

I found the solution of my problem. I have been changing /etc/snmp/snmptrapd.conf and mysql logging didnt worked. I just find that there is another snmptrapd.conf in /usr/local/etc/snmp/snmptrapd.conf that i fill with the configuration showed in my first post. So far it works!

0
NoobDeveloper On

I have found an article for you:

http://ethertype.blogspot.com/2015/10/logging-snmp-traps-to-mysqlmariadb.html

You must set your database name as "net_snmp".