Commit Graph

90 Commits

Author SHA1 Message Date
Adrian Schmutzler 71802221a0 Remove hoodsv1 table and corresponding interface with KeyXchangeV1
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2019-05-11 23:52:32 +02:00
Adrian Schmutzler 6efd0bda59 api/alfred: Only use single hood for V1
This removes code to evaluate the position of a V1 router.

Distinction between Default and NoCoordinates is dropped.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2019-05-11 23:51:53 +02:00
Adrian Schmutzler 61e2e4600b MySQL: Make all hood IDs unsigned
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2019-05-11 23:50:08 +02:00
Adrian Schmutzler bb61351fbf Polyhoods: Introduce database support and read functions
Polyhoods need to be read manually. Running
scripts/readpolyhoods.py will erase both tables and reread data.

At the moment, the URL points to a test setup.

This requires changes to the MySQL database!

This is meant for later use and does NOT add any data to the
Monitoring at the moment.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2019-05-11 23:50:03 +02:00
Adrian Schmutzler f26f01f73c statistics.html/gws.html: Show gwinfo version of gateways
This requires changes to the MySQL database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2019-05-11 23:49:14 +02:00
Adrian Schmutzler 95a67bf0a4 db/*: Add quotes for all tables and fields
This is a cosmetic change only meant to harmonize style.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-11-23 14:14:10 +01:00
Adrian Schmutzler c6fdf34a0a MySQL: Increase size of field gw_class
Former field seemed to cut certain values.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-11-23 14:14:10 +01:00
Adrian Schmutzler 0bf2312fe4 Global: Put hoods into table and use smallint for reference
This will reduce size of stats_hood and, more importantly,
make hood assignment independent of hood name changes:

Previouly: Name change = changing string in every place
Now: Name change = change of one table entry

This requires changes to the MySQL database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-11-23 13:14:50 +01:00
Adrian Schmutzler dd6d101ccd Global: Identify local routers and indicate their status
This detects local routers based on knowing their hood, but not
having the hood listed in hoodsv2 table.

This classification is performed when the routers' alfred data
is parsed. Thus, offline routers won't change.

This requires changes to the MySQL database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-11-23 13:14:50 +01:00
Adrian Schmutzler b38af9a74b Global: Read V1 hoods from KeyXchange
This obsoletes the hood initialization file.

Hood are capitalized and "V1" is added at the end.

This may require a rename of the existing hood stats.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-11-23 13:14:50 +01:00
Adrian Schmutzler 77bd43c73a Global: Add V2 hoods to table
This requires changes to the MySQL database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-11-23 13:14:50 +01:00
Adrian Schmutzler c1c728f2a3 Global: Convert IPv4/IPv6 from char to numbers/binary
This is done for tables router_ipv6 and router_netif.

This is not done for table gw_netif (contains subnet masks).

This requires changes to the MySQL database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-11-23 13:14:50 +01:00
Adrian Schmutzler bc3460f2e0 Global: Change MAC address storage to use BIGINT
This requires changes to the MySQL database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-11-23 13:14:41 +01:00
Adrian Schmutzler 478c0fb8dd gwinfo: Support internal IPv4/IPv6 and DHCP ranges (v1.4)
This updates gwinfo script AND evaluation code.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-11-22 18:37:30 +01:00
Adrian Schmutzler f6e9aec960 init_db: Add missing gw tables
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-07-03 13:45:40 +02:00
Adrian Schmutzler aa99035e23 statistics.html: Show aggregated traffic for hoods and total
This patch aims at showing the client-caused traffic. We use
bat0 for this, at this seems to be the easiest way which does not
require router-specific ifs etc.

This patch distinguishes between routers and gateways:

- For routers, we just use the bat0 data
- For gateways, we aggregate eth0.1, eth1.1, w2ap and w5ap

This requires changes to the MySQL database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-07-03 13:45:40 +02:00
Adrian Schmutzler 5e60c70ca5 api/alfred: Introduce gateway field
This introduced a boolean gateway field, which is set based on
the gateway connections sent via alfred.

If a device provides no gateways which it is connected to, it is
assumed to respresent a gateway.

This requires changes to the MySQL database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-07-03 13:45:29 +02:00
Adrian Schmutzler c8178beedd gwinfo and scripts/deletestats: Delete old netif data
Netif information is deleted 48 hours after the MAC addresses
have changed.

This requires changes to the MySQL database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-04-16 12:42:35 +02:00
Adrian Schmutzler f6f699c8c7 api/alfred and router.html: Include routing_protocol
This only works for routers with updated nodewatcher.

This requires changes to the MySQL database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-22 16:45:32 +01:00
Adrian Schmutzler 146d64da19 api/alfred and router.html: Retrieve and show traffic control status
This only works for routers with updated nodewatcher.

This requires changes to the MySQL database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-22 16:44:44 +01:00
Adrian Schmutzler 89ad846375 routertools: Use float for neighbor and gateway quality
This enables support for BATMAN V.

This requires changes to the MySQL database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-22 16:27:18 +01:00
Adrian Schmutzler d298cc7762 Introduce v2 field in router table
If a router sends his hood, it is considered to be V2.

V2 hoods are highlighted on the statistics page.

This requires changes to the MySQL database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-22 16:23:54 +01:00
Adrian Schmutzler 8d41ed9838 api/alfred and router.html: Introduce airtime stats
This only works for routers with updated nodewatcher.

This requires changes to the MySQL database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-02 13:25:06 +01:00
Adrian Schmutzler 1cffed9f79 api/alfred and router.html: Introduce detailed client stats
This only works for routers with updated nodewatcher.

This requires changes to the MySQL database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-02 13:14:35 +01:00
Adrian Schmutzler 907b3154a9 api/alfred: Introduce NoCoordinates hood
Previously, mesh routers without coordinates are assigned to the
default hood, even if they are meshing with routers from other
hoods.

To keep the default hood clean, we introduce the "NoCoordinates"
hood for all those routers.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-02 13:01:02 +01:00
Adrian Schmutzler 4dab09748c Introduce option to set routers as blocked by KeyXchange
This requires changes to the MySQL database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-02 12:59:05 +01:00
Adrian Schmutzler 662bec1a16 Change GWinfo to store vpnmac instead of vpnif
This is required to uniquely find the relation between VPN and
bat after change of MAC adresses.

This requires changes to the MySQL database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-02 01:09:49 +01:00
Adrian Schmutzler 4f4452e06f db/*: Add missing commit to database
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-01-15 12:30:08 +01:00
Adrian Schmutzler 898c06d8c6 Introduce infrastructure to receive and process gateway information
This requires changes to the MySQL database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-01-15 12:30:08 +01:00
Adrian Schmutzler ceddd7f636 Add gateway-specific statistics
This adds gateway stats which work similar to the detailed hood
statistics.

This requires changes to the MySQL database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-01-15 12:29:55 +01:00
Adrian Schmutzler f12a3f5a3e api/alfred and router.html: Collect and show gateway information
This requires changes to the MySQL database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-01-15 00:10:29 +01:00
Adrian Schmutzler 55dc7b4ad5 Rename net_if from router_neighbor table to netif
This includes various changes throughout the code. Additionally,
some fields are reordered.

This requires a change of the MySQL table router_neighbor!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 18:21:08 +01:00
Adrian Schmutzler effcdf0a39 MySQL: Reduce field size for rx/tx in router_netif to uint32
This is just a change of the database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 18:18:26 +01:00
Adrian Schmutzler 858f419e54 api/alfred and router.html: Show WiFi data for netifs
This shows information about WiFi parameters (e.g. channel).

Except the Tx-Power, data is only available if a firmware with
a corresponding nodewatcher update is present (version 44).

This requires a change of the MySQL table router_netif!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 18:08:41 +01:00
Adrian Schmutzler ebe9c3afa1 MySQL: Remove net_if from router_neighbor primary key
Since all meshing interface have different MAC adresses, the
mac itself should be unique.

This is just a change of the database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 18:08:41 +01:00
Adrian Schmutzler 22be8633c5 MySQL: Make rx_bytes/tx_bytes in router_netif UNSIGNED
This is just a change of the database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 18:08:28 +01:00
Adrian Schmutzler 82118eed92 MySQL: Reorder fields in stats_hood table
This is meant to reflect the order of the primary key.

This is just a change of the database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 18:04:12 +01:00
Adrian Schmutzler 069da3aac4 MySQL: Reorder fields in router stats tables
This is meant to reflect the order of the primary key.

This is just a change of the database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 18:04:12 +01:00
Adrian Schmutzler 47f43eab0d global/hood stats: Include orphaned routers in statistics
This requires a change of the database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 18:04:12 +01:00
Adrian Schmutzler 92bd81f56d MySQL: Change size of MAC address fields to CHAR(17)
This is just a change of the database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 18:04:12 +01:00
Adrian Schmutzler 58a3747be8 MySQL: Reduce field size for hood to VARCHAR(30)
This is just a change of the database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 18:04:12 +01:00
Adrian Schmutzler a44970425e MySQL: Reduce size of counters for global/hood stats
This is just a change of the database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 18:04:12 +01:00
Adrian Schmutzler 8b4ef93a17 MySQL: Change loadavg field size to float
This is just a change of the database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 18:04:12 +01:00
Adrian Schmutzler 3eb172bb70 MySQL: Reduce field size for router ID in all tables
This is just a change of the database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 18:04:12 +01:00
Adrian Schmutzler 87d7e345c8 MySQL: Reduce field size for rx/tx in router_stats_netif to uint32
This is just a change of the database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 18:04:00 +01:00
Adrian Schmutzler 58ce32e322 Change router_stats_netif to use ids for netifs
This introduces a serious of changes to code and database.

This patch requires changes to the MySQL database.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 17:18:22 +01:00
Adrian Schmutzler 0f163c87ee MySQL: Add index for deletebit in router_stats_netif
This index drastically reduces the time required for the DELETE
commands, while the other commands are not affected to strongly.

This is mainly a change to the database.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-21 17:07:54 +01:00
Adrian Schmutzler d26dda7044 MySQL: Re-add keys for router/hood in stats
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-21 17:06:42 +01:00
Adrian Schmutzler 8d9f14b954 MySQL: Reorder primary key fields for stats
Use time for first indexed field so it is indexed individually

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-21 17:06:37 +01:00
Adrian Schmutzler 032b7ce15e MySQL: Reduce size of netif fields to 15 (Linux limit)
This is mainly a change to the database

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-21 17:06:31 +01:00