Commit graph

43 commits

Author SHA1 Message Date
Simone Mainardi
9eb7b7ab65 Prevents possible MySQL errors caused by long queries
Maximum query size has been raised from 2048 to the hardcoded
constant CONST_MAX_SQL_QUERY_LEN that is currently equal
to 8192.

A warning message is generated when attempting to execute
queries longer than the maximum allowed values that would
be truncated.

Fixes #511
2016-04-20 14:45:57 +02:00
Simone Mainardi
59d427841d Fixes possible duplicated flow dumps 2016-03-29 14:34:06 +02:00
Luca Deri
0aa87b7c9b Spring cleaning 2016-03-28 14:16:27 +02:00
Luca Deri
99668c736d Merge branch 'dev' of https://github.com/ntop/ntopng into dev
Conflicts:
	src/MySQLDB.cpp
2016-03-26 22:57:01 +01:00
Luca Deri
fac51e9fca Reworked MySQL interface 2016-03-26 22:52:54 +01:00
Simone Mainardi
63b09fc516 Prevents insertion of queries longer than max allowed size 2016-03-26 22:46:42 +01:00
Simone Mainardi
a707d9a880 Flushes flow queues when migrating between MySQL formats 2016-03-26 22:24:19 +01:00
Luca Deri
ef6fdebf63 Fixes in MySQl batch 2016-03-26 22:00:56 +01:00
Simone Mainardi
46e803d597 Prevents a possible memory leak 2016-03-25 20:04:00 +01:00
Simone Mainardi
2754c2dfa1 Stores integer interface ids into MySQL
Interface flows are now stored using integer interface ids rather
than interface names. This speeds up queries.
A migration code has also been introduced so that old MySQL table
format is migrated and old data does not get lost.

This also fixes #460
2016-03-25 19:58:00 +01:00
Simone Mainardi
c5c1a062f6 Implements MySQL batch flow insertions 2016-03-22 15:46:19 +01:00
Luca Deri
4295e7621b Patch for reopening MySQL connection
Lowered goodput threshold to avoid false positives
2016-03-11 19:13:02 +01:00
Luca Deri
67016b08f8 Silly bug 2016-03-07 20:10:19 +01:00
Luca Deri
83360abc1c Modified preferences nBox label
Fifed MySQL connection leak in case of reconnection
2016-03-06 23:29:36 +01:00
Luca Deri
905d9eb9e7 yes another fix for MySQL server gone 2016-03-04 20:56:33 +01:00
Luca Deri
031056a07f Fix for server gone error 2016-03-02 07:34:52 +01:00
Luca Deri
1fcc09e26c Fix for reconnecting in case of idle MySQL connection 2016-03-01 12:33:49 +01:00
Simone Mainardi
165be14dfd Makes the maximum number of rows retrieved from MySQL configurable
The limit in the number of rows that can be retrieved from MySQL
has been made configurable. This is useful especially when downloading
historical flows in txt format.
2016-02-19 20:14:29 +01:00
Simone Mainardi
110725736a Shortens a MySQL indexed field (fixes #389) 2016-02-13 12:35:58 +01:00
Luca Deri
2915d89a24 Implemented asynchronous MySQL queries so that ntopng should be more responsive on large networks with MySQL database enabled 2016-02-09 16:10:39 +01:00
Simone Mainardi
beed2dfdee Adds efficient MySQL indices, resolves #361 2016-01-26 12:16:51 +01:00
Luca Deri
d7c452f0a3 Moved to 2016 2016-01-01 09:27:39 +01:00
Simone Mainardi
0c92e286d4 Reworks MySQL structure and adds interface support to dumped flows
Existing MySQL naming convention makes two separate tables for each interface monitored. Table names are flows4_<ifid> and flows6_<ifid>. Ifid is a unique integer identifier chosen by ntopng.

Present commit simplifies this structure and make just two tables, namely flows4 and flows6, and add an extra column to store the interface names. I do not think that storing the integer interface id is good: it is just a number that only make sense inside ntopng. Using interface names would yield more (re)usable data.

Committed code transparently migrates old tables into the new ones. Old flows are migrated into the new tables, and old tables are dropped.
2015-12-07 17:20:12 +01:00
Simone Mainardi
6fe11c37c0 Adds MySQL index on column NTOPNG_INSTANCE_NAME 2015-12-07 16:01:14 +01:00
Simone Mainardi
2228a8529c Adds ntopng instance name (#283)
ntopng instance name can be specified using command line parameter
--instance-name. If no parameter is specified, instance name defaults
to the current host name.

this information is exported to MySQL and ES.
2015-12-07 15:32:00 +01:00
Simone Mainardi
71b390ec47 Adds MySQL support for traffic profiles
Traffic profile information is dumped to MySQL.
2015-11-10 11:36:55 +01:00
Luca Deri
631d54781e MySQL/MariaDB is now compulsory to compile ntopng 2015-10-16 14:56:01 +02:00
Luca
5b1cd6878a Added alter table for old MysSQL DBs 2015-10-06 13:11:18 +02:00
Luca Deri
a62344d45c Added field INFO to MySQL flows.
If you update the code, you need to drop or modify the MySQL database format.
2015-09-22 22:37:11 +02:00
Luca Deri
73618dbcbe Fixes for SQL escaping
Improvement of DB reporting when showing Ip communications with no ports
2015-08-17 17:04:33 +02:00
Luca Deri
2a5baca948 Various flow dump improvements and bug fixes 2015-08-17 10:57:17 +02:00
Luca Deri
4945f5c902 Added ability to navigate IPv4 and IPv6 flows 2015-08-16 23:44:01 +02:00
Luca Deri
e59d699837 Added initial work towards a new historical interface. In the Interfaces->name->Historical Actitivity it is now possible to see top flows when -F "mysql;...." is used 2015-08-16 15:00:40 +02:00
Luca Deri
3b72506ab0 Added the ability to query flows from Lua
Added simple testing tool db_query.lua to issue queries
2015-08-15 20:38:01 +02:00
Luca Deri
8cf586a06a Enlarged buffer for MySQL queries 2015-08-10 19:19:33 +02:00
Luca Deri
26a30bd313 MySQL tables have now as format _<interfaceid> 2015-08-10 17:56:53 +02:00
Luca Deri
ca4eb395c8 Reworked bitmap implementation
Fixed but in MySQL that caused a deadlock
2015-08-10 17:54:46 +02:00
Luca Deri
fd3b7d2b29 Added interfaceId to the MySQL tables 2015-08-10 15:53:50 +02:00
Luca Deri
6c0e60ad36 Fix for reentrancy in MySQL 2015-08-10 15:40:48 +02:00
Luca Deri
8133cb7eb7 MySQL
- Added support for MariaDB (in addition to MySQL)
- Implemented reconnection if server/client disconnects
- Added support for both host and Unix socket connection to the DB
2015-08-10 11:55:53 +02:00
Luca Deri
a220e593c5 Added fix for handling mysql reconnect 2015-08-10 09:14:31 +02:00
Luca Deri
e9995ceb62 Renamed some Ndpi -> nDPI API calls
Removed geohash: we're back top latitude longitude
Implemented flow insert into MySQL
2015-08-09 22:58:13 +02:00
Luca Deri
900484b2e0 Reworked DB structure 2015-08-09 15:54:18 +02:00