Commit Graph

410 Commits

Author SHA1 Message Date
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
516eb07924 stattools: Improve code for calculation of global/hood/gw stats
This replaces UPDATE IF SELECT ELSE INSERT by ON DUPLICATE KEY
UPDATE. In addition, queries have been consolidated by ordering
data in advance and then using executemany.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-01-15 12:30:08 +01:00
2a515b94c7 config/routertools: Set minimum distance for data in router stats
This implement to different minimum distances in seconds for the
router stats in general and the netif stats in particular.

The values are chosen so that they are 30 secs. shorter than the
desired timespans of 5 and 10 minutes, to allow for fluctuation
in when data arrives.

This fixes the data density increase caused by V2 Hoods with two
gateways.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-01-15 12:30:08 +01:00
70f2f0a8a3 statistics.html: Change link label for hood statistics
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-01-15 12:30:08 +01:00
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
34a7c4c58e statistics.html: Add gateway overview
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-01-15 12:27:15 +01:00
d567dfd56d router.html: Add gateway links
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-01-15 12:27:07 +01:00
d7bdca4797 helpers: Enable search for gateways
Introduces two new query parameters:
gw:<mac> looks for routers being aware of the specified gateway
selected:<mac> looks for routers CONNECTED to the specified gw

Both variants support regex.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-01-15 00:21:17 +01:00
386384212e statistics.html: Fix layout of upper right divs
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-01-15 00:21:17 +01:00
0af1c76254 statistics.html: Consolidate code
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-01-15 00:21:11 +01:00
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
c3adf5fd68 api/alfred: Only log reboot if uptime difference greater than 5 min
If we have two gateways per hood, uptime may vary and cause
frequent logged reboots.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-01-13 16:46:45 +01:00
de7c5b2874 router.html: Highlight WiFi interfaces details
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-01-13 16:45:16 +01:00
232e8fe6f0 scripts/calcglobalstats: Add marker at the end of logged durations
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-01-13 16:45:03 +01:00
01e38d84ab Changelog: Update
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 18:21:08 +01:00
03ef1a8f70 router.html: Make events scrollable to show more than five
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 18:21:08 +01:00
9375c2f891 statistics.html: Adjust design of pie charts
Minimum percentage for firmware increased to 2 per cent, for
routers increased to 3 per cent.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 18:21:08 +01:00
d8db4b2f9d router.html: Clarify Report Router button text
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 18:21:08 +01:00
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
39d9ddc9d0 api/alfred: Update router data instead of DELETE/INSERT
Previously, I just deleted all entries and recreated them again
with INSERT. Although this is simple to write and actually includes
less queries, it causes a lot more write IO. Since most of the
neighbors and interfaces do NOT change frequently, it is worth the
extra effort to delete only those really gone since the last
update.

Only br-mesh will normally have assigned IPv6 addresses, thus
we just delete all IPv6 adresses of the other ones.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 18:21:08 +01:00
55f81c4295 api/alfred: Change calculation of rx/tx after reboot
Previously, on restart the traffic of the last period before
the restart was reused.

Now, we use the logged traffic divided by the uptime.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 18:19:24 +01:00
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
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
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
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
7ef6f47c4e routertools: Reorder fields in INSERT queries for router stats
This is a cosmetic change to realign the INSERTs to the database.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 18:04:12 +01:00
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
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
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
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
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
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
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
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
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
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
ec66c05361 api/nodelist: Fix condition for coordinates
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 17:15:54 +01:00
60b6ada1f2 index.html: Fix HTML validity
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 17:15:38 +01:00
23dd78d1da router.html: Fix HTML validity issue
Fixes #67.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 17:15:32 +01:00
43280caee1 user.html: Fix HTML validity
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 17:15:18 +01:00
a6ecfae9b6 map: Show Coordinates if not clicking on router icon
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 17:14:19 +01:00
71bb5a3a68 map: Show router popup only for selected layer
If KeyXchange v1 routers are not shown, their popup windows are
now also disabled (as the user would expect); same for v2.

Fixes #95.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 17:12:12 +01:00
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
0052b87a0c config: 30 Events per router are stored instead of 20
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-21 17:07:36 +01:00
9c900e2552 config: Router stats are stored for 30 days instead of 14
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-21 17:07:29 +01:00
8c46e93ddd Changelog: Update
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-21 17:07:23 +01:00
bf4ea20c2e index.html: Update github link
Fixes #106

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-21 17:07:17 +01:00
5e8e399a70 statistics.html: Filter hood when clicking sectors in pie charts
Fixes #107

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-21 17:07:07 +01:00
a3ee0edead routertools/alfred: Replace empty hostname
Fixes #109

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-21 17:06:59 +01:00
b5a33f6e70 resetpw: Fix variable name and tidy up
Fixes HTTP 500 error.

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