Commit Graph

547 Commits

Author SHA1 Message Date
Adrian Schmutzler 6872b61cb0 api/routers: Tidy up unnecessary variables
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-02 13:32:05 +01:00
Adrian Schmutzler b1110e95bd api/routers: Add loadavg to data
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-02 13:32:05 +01:00
Adrian Schmutzler 0b8998eb0b stattools: Sort data from router_firmwares() and router_models()
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-02 13:32:05 +01:00
Adrian Schmutzler 59aa790116 maptools: Prevent drawing mesh connections twice
Quality is calculated as average of two connections where required.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-02 13:31:56 +01:00
Adrian Schmutzler 8fdcfc5a11 statistics.html: Adjust combine threshold for firmware pie chart
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-02 13:26:21 +01:00
Adrian Schmutzler 0451480d91 router.html: Show bit per second for data rates
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-02 13:25:34 +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 ef9ea75c11 Add restart.sh, start.sh, stop.sh
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-02 13:02:51 +01:00
Adrian Schmutzler b43be1bfcc user.html: Log off user after he deleted himself
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-02 13:02:27 +01:00
Adrian Schmutzler c3c0c54715 user.html: Fix delete account button
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-02 13:02:21 +01:00
Adrian Schmutzler d03edb4552 Changelog: Update
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-02 13:01:50 +01:00
Adrian Schmutzler 0b04098629 api/gwinfo: Switch from ON DUPLICATE KEY UPDATE to if/else
This prevents excessive use of AUTO_INCREMENT

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-02 13:01:28 +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 94b9d92b8a statistics.html: Check for GW and hood when using selector
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-02 12:56:41 +01:00
Adrian Schmutzler a5b06d62c6 statistics.html: Make hood and GW tables sortable
This causes some adjustments in the underlying select queries.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-02 12:56:34 +01:00
Adrian Schmutzler d8e9add933 statistics.html: Show number of gateways in hood table
The number counts all GWs with 2 or more online routers.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-02 12:54:23 +01:00
Adrian Schmutzler 0ce3fa5c2f routertools: Set rx/tx to zero if router gets offline
This has to be done BEFORE the status is set, since otherwise
the selector won't work anymore.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-02 12:52:27 +01:00
Adrian Schmutzler 9e990bc98a statistics.html: Sort GWs by netif name if same GW
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-02 12:50:19 +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 0dea6339e2 api/gwinfo: Stop filtering br-* interfaces
Keep br-* interfaces, throw away l2tp.
Seems like batctl gwl only shows br-* or fff*, but never l2tp*.

Seems to be required to support V1 gateways with L2TP.

The main impact on table size is done by l2tp*.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-02 01:04:49 +01:00
Adrian Schmutzler 9da232ac50 router.html: Fix code flow to provide JSON without reading stats
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-02 01:02:22 +01:00
Adrian Schmutzler 05c6af708f statistics.html: Replace clients per GW column by unknown routers
The clients per GW cannot by determined reliably in the
Monitoring. Thus, we remove the column and readd the previously
removed "unknown" column.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-02 01:02:00 +01:00
Adrian Schmutzler c71849efe4 router.html: /mac/<routermac> now supports GET parameters
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-02 01:01:03 +01:00
Adrian Schmutzler 58cc2e167f scripts/deletestats: Do not evaluate status in stats deletion
Previously, old stats had been only deleted if the router was
online. This required a join with the router table, which caused
locking issues when writing to this table by alfred request.

Now, we just delete old stats ignoring the router state, except
for the router_stats table, which is smaller and thus remains
as before.

In addition, this patch logs the number of rows affected.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-02 01:00:44 +01:00
Adrian Schmutzler 804ce80472 scripts/deletestats.py: Delete netif stats after 21 days
This adds an additional config value to set the deletion threshold
for netif data.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-01-15 12:30:09 +01:00
Adrian Schmutzler 59fcf2fa8f Changelog: Update
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-01-15 12:30:09 +01:00
Adrian Schmutzler 823858d981 scripts: Add deleteunlinked.py
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-01-15 12:30:09 +01:00
Adrian Schmutzler c605ffe2f0 statistics.html: Show MAC addresses for known gateways in list
This shows the VPN and batX addresses.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-01-15 12:30:09 +01:00
Adrian Schmutzler 0a2b8b9a8b statistics.html: Remove "unknown" column from gateway list
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-01-15 12:30:09 +01:00
Adrian Schmutzler a9912dccd2 statistics.html: Show details about selected gateway
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-01-15 12:30:09 +01:00
Adrian Schmutzler 452aa5a009 statistics.html: Provide sorted list of gateways
Gateways are listed alphabetically based on their name, then all
without name based on their MAC address.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-01-15 12:30:09 +01:00
Adrian Schmutzler ff0aeca1aa helpers: Enable search for gateways based on batX interface MACs
Introduces two new query parameters:
bat:<mac> looks for routers being aware of the specified gateway
batselected:<mac> looks for routers CONNECTED to the specified gw

Both variants support regex.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-01-15 12:30:09 +01:00
Adrian Schmutzler 669895cd7b router.html/statistics.html: Display gateway/batX where available
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-01-15 12:30:08 +01:00
Adrian Schmutzler 1d64dc3e25 statistics.html: Add logging of 500 errors
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-01-15 12:30:08 +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 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
Adrian Schmutzler 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
Adrian Schmutzler 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
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 34a7c4c58e statistics.html: Add gateway overview
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-01-15 12:27:15 +01:00
Adrian Schmutzler d567dfd56d router.html: Add gateway links
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-01-15 12:27:07 +01:00
Adrian Schmutzler 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
Adrian Schmutzler 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
Adrian Schmutzler 0af1c76254 statistics.html: Consolidate code
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-01-15 00:21:11 +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 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
Adrian Schmutzler de7c5b2874 router.html: Highlight WiFi interfaces details
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-01-13 16:45:16 +01:00