-
-
Notifications
You must be signed in to change notification settings - Fork 455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Logging to external MariaDB/Microsoft SQL Servers though new App(s) #1143
Comments
Thanks for the request. This is already planned but not getting prioritized due to some pending features being worked on. |
Technitium DNS Server v13.4 is now available which adds Query Log apps for MySQL and MS SQL Server. More DB support will be added soon. Do update and let me know your feedback. |
What are the database schema/tables? I don't see a sql database to import with that preconfigured and it doesn't create it if it sees the tables are missing.
|
Found the source where it should create the tables, but it didn't do it. I ran the SQL script against the database and it successfully created the required tables. f00c5e3#diff-b937ebc0cb2d5b4d8b759e116ccb59574900e117469ecac3c9aade6f401908faR330
|
Running into another issue where it's attempting to connect to the database
Config:
|
So the previous error is with logging enabled. Disabling that will allow connections. Logs do not seem to update live, sometimes restarting the dnsserver docker container will dump the logs into the mysql database. Not sure what I'm missing there. |
@dasunsrule32 thanks for the feedback. There are some issues which I will get fixed with an update soon. The app also needs you to grant privileges manually from mysql admin prompt to work.
If you disable logging in config then the app will stop working. When logging is enabled, the app will take max 10 sec to update the logs to database, its done with a bulk update and not updated immediately. |
Great! What permissions does it need? I only assigned all permissions to that user on the database in question only. |
For now, give permissions to the mysql db too. Once the update is available, this can be revoked. |
I just gave it read-only access to the |
Technitium DNS Server v13.4.1 is now available with update to the MySQL and MS SQL Server apps. Do update and let me know your feedback. |
Just reconfigured my servers to log using MS SQL and so far it is working wonderfully. Works much nicer via Grafana instead of shipping all the logs over to a Loki instance. Queries via the Technitium web interface against the SQLite DB with 6 million logs took about 10 seconds without time filters. Might see if I can import the SQLite DB into MS SQL for the historic data and see what the performance impact is. |
@gigantuar thanks for the feedback. |
Thanks for working on this. Unfortunately Fortunately |
@Cossey thanks for the feedback.
Yes, MariaDB will need a separate app to make it work.
I am not really sure but I think The code for the app will be almost the same with minor changes. If you manage to get it working for both Windows and Linux platforms then do make a PR. |
I just did it now, took like 5 minutes. I copied the MySQL app into a new folder, everything the same BUT:
It was a drop in replacement so no changes to code required. Everything including config remained the same. Zipped up the compiled and uploaded to tdnss! MySqlConnector is cross platform AFAIK. I actually use it in another .net app running in docker on debian bookworm (I use tdnss in docker on top of Debian Bookworm also). Obviously more testing is required. I can do a pull request, but busy working full time so may not happen soon. However as the MySqlConnector is also compatible with MySQL, might be worth considering this vs the MySqlClient? That way it can cover both databases without having another app, if the testing works for others. |
@Cossey In that case, having the existing app use |
I was able to remove the permissions to |
@dasunsrule32 Thanks for the feedback. |
I would love for all the DNS requests to be logged to an external SQL server. I personally am looking for MariaDB support, but it makes sense to support Microsoft SQL Server also.
It would likely be a similar to the "Query Logs (sqllite)" app. Most likely, I assume this would be the App to base these other two on, with the SQL specific syntax and libraries dropped in and replaced.
The benefit for this would be:
The text was updated successfully, but these errors were encountered: