fln / addrwatch

A tool similar to arpwatch for IPv4/IPv6 and ethernet address pairing monitoring.
GNU General Public License v3.0
184 stars 30 forks source link

problem with mysql database #29

Closed cuns closed 2 years ago

cuns commented 2 years ago

hi everyone, i installed addrwatch and enabled mysql support in a container with alpine OS but i can't find the way to save the output in my mysql database. I tried the "addrwatch -m [database] ..." command on alpine and a debian virtual machine but it was unsuccessful. I tried the configuration "./configure --enable-sqlite3" and then I ran the command "addrwatch -s database.db" on the debian machine and it saved things correctly. I looked at the documentation at the following link https://www.mankier.com/8/addrwatch#Info and I saw that there are different parameters than those shown by the command "addrwatch --help", in the current documentation I have not seen parameters that allow you to pass the database unlike what is shown in the link. what could be the problem with mysql?

Thank you

fln commented 2 years ago

Hi @cuns. To store addrwatch logs to MySQL database a separate process addrwatch_mysql needs to be started. Main process addrwatch logs all the events into shared memory segment, while addrwatch_mysql process reads data from shared memory and stores it into the DB.

Sqlite3 output is still supported as a built-in output mode for the main binary, but this is legacy functionality. To make it uniform with other output modes it should be moved to separate tool addrwatch_sqlite.

cuns commented 2 years ago

thanks you @fln , now i have figured out how to make it work properly.