Commit Graph

590 Commits

Author SHA1 Message Date
Adrian Schmutzler 7203d594f3 map: Add extra layer for position popup
By default, position popup is off again until you select the layer:
With the layer enabled, behavior is as before.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-04-16 13:11:38 +02:00
Adrian Schmutzler 2fcd8af88e router.html: Only load netif data when clicked
The data for each netif is only loaded when the respective row
is clicked.
Correspondingly, br-mesh is loaded initially.

So far, it is unclear how big the impact of the netif filter in
MySQL transactions is, as those have no key of their own.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-04-16 13:10:53 +02:00
Adrian Schmutzler ab89b6a144 router.html: Don't load full neighbor stats, but only on demand
With this patch, only the neighbor stats for the last day are
loaded by default. If you want more, a hyperlink is implemented
for this purpose.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-04-16 13:07:20 +02:00
Adrian Schmutzler c7ee598e16 statictics.html: Show router models with smaller share
This also enables one decimal place for tooltips.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-04-16 12:50:36 +02:00
Adrian Schmutzler f2d9cc590d README: Add dependency and cron script call
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-04-16 12:50:27 +02:00
Adrian Schmutzler e2011c0808 config and router.html: Increased number of stored events
Since events do not cost much, the number stored and displayed
is drastically increased.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-04-16 12:50:11 +02:00
Adrian Schmutzler 8eb207e04e api/alfred: Suppress duplicate key errors for stats (workaround!)
Sometimes two queries want to insert the same entry into the
router stats table, although we check for that right before the
query is made. One can suppress this by using ON DUPLICATE KEY UPDATE
to ignore the second (redundant) entry.

This is no fix, but will work until this is examined more thoroughly.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-04-16 12:50:01 +02:00
Adrian Schmutzler 2b17115253 config: Reduce offline_threshold to 10 minutes
Since the gaps between alfred calls have been fixed, we can
reduce the waiting time before a router gets offline.

We now only tolerate a single missing data point, but not two
like before.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-04-16 12:49:53 +02:00
Adrian Schmutzler a57d459c77 api/alfred: Disable router_rate_limit_list
With router_rate_limit_list, routers were not processed if the
time difference between calls was less than 5 minutes for the
same MAC address.

While this is generally not bad, there are some drawbacks:
- Not having been aware of this fact, we have established other
  mechanisms to dilute data density, which might have interfered
- With KeyXchangeV2, two gateways will send data with less than
  5 min. difference. As gateways are not connected, we know that
  we alternately receive newer and older data. With
  router_rate_limit_list, some of this data has been discarded
  before its "age" was evaluated. This caused an unwanted additional
  dilution of data which might have caused "offline" routers not
  being actually offline (for a short period)
- With KeyXchangeV1, if the second call was a little earlier, the
  a big share of the data would not be "new enough" and just be
  discarded
- With KeyXchangeV1, the same would happen for the order of records
  varying between alfred calls, were some records would have more and
  some less than 5 minutes time difference

To get rid of these issues, we remove router_rate_limit_list and
test whether the newer measures to dilute data are effective.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-04-16 12:49:34 +02:00
Adrian Schmutzler c77e04ee7f api/alfred: Evaluate utcnow() only once for the whole alfred dataset
Since the time is used as key in MySQL, this might help to solve key
race conditions where new_router_stats is entered at the same time.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-04-16 12:49:23 +02:00
Adrian Schmutzler d1fd5e2bf9 api/alfred: Optimize delete queries for IPv6
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-04-16 12:48:28 +02:00
Adrian Schmutzler 68dff475d2 api/alfred: Use individual transactions to delete router data
This patch uses smaller (but more) transactions to delete router
data. This makes lock more specific and thus prevents deadlocks
quite effectively.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-04-16 12:45:44 +02:00
Adrian Schmutzler b93ed81c34 Enforce https for login page link
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-04-16 12:45:24 +02:00
Adrian Schmutzler f50fb4ed6e router.html: Add maximum value for airtime plot
This will cut defective 5 GHz data bigger than 100 %.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-04-16 12:45:15 +02:00
Adrian Schmutzler d6b7ce8e1e config: Introduce specific stats deletion threshold for gw history
Value set to only 7 days to reduce database size, since these
data seem to be of little relevance.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-04-16 12:45:01 +02:00
Adrian Schmutzler e499315dec api: Introduce dnslist and dnsentries
This provides lists of V2 routers to be used in DNS servers:

/api/dnslist - Plain tab-separated list to be used in custom scripts

/api/dnsentries - List of zone file entries without a header

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-04-16 12:44: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 1fa8cf3206 Changelog: Update
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-22 16:53:21 +01:00
Adrian Schmutzler 8b97e05af5 router_list.html: Make uptime sortable
Offline routers are assumed to have uptime=0.

Minor design changes included.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-22 16:53:15 +01:00
Adrian Schmutzler b9aab43459 router_list.html: Show last contact
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-22 16:53:03 +01:00
Adrian Schmutzler c581915076 api/alfred: Remove router hardname name correction for old FW
This only affects 0.5.1 and older.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-22 16:46:52 +01:00
Adrian Schmutzler 488a8a2c63 router.html: Show warning if no contact address is set
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-22 16:46:41 +01:00
Adrian Schmutzler 5d7e00422e api/alfred: Check for new router data initially by system time
If we receive data from more than one gateway, there happens to
be a mix of older and newer data (since synchronization between
gateways seems to be not working).

To deal with that, we now only accept data where the router's
system time is newer than the value stored in the DB. To account
for time synchronization issues, we also accept data which is more
than one hour older.

This patch removes other checks for old data which are now obsolete.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-22 16:46:31 +01:00
Adrian Schmutzler d3ea76b648 scripts/deletestats: Use block-wise delete for more stats tables
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-22 16:46:20 +01:00
Adrian Schmutzler c208663f70 router.html/map: Treat quality differently based on routing protocol
Adds display support for BATMAN_V data.

This is step 1 of 2. It does change the background colors for
neighbors, but does NOT change the link colors in the map.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-22 16:45:40 +01: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 d82e7bf5a7 map: Only show coordinates on second click
First click closes open popup.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-22 16:45:22 +01:00
Adrian Schmutzler 1a32a823db router.html: Readjust map size to System panel
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-22 16:45:08 +01:00
Adrian Schmutzler 49a9c6618f router.html: Show current airtime values in addition to plot
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-22 16:44:58 +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 6188443dc9 router.html: Show gateway names in connection quality plot
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-22 16:44:32 +01:00
Adrian Schmutzler 84eb048904 router.html: Log blocked status changes to router events
Like normal router events, the block/unblock events are deleted
if they become old enough.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-22 16:44:17 +01:00
Adrian Schmutzler 3742f5415d router.html: Add explanation and color highlighting for netifs
Label netifs AFTER json if clause

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-22 16:42:31 +01:00
Adrian Schmutzler 9924e4fa36 map.js: Change blue color
Increases visibility of links.

Same color change has already been performed earlier for the
neighbors in router.html.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-22 16:36:34 +01:00
Adrian Schmutzler 825f79aa66 router.html: Support babel cost and BATMAN V in neighbor graph
This patch uses the absolute value for plotting and removes the
graph maximum. A dynamic upper margin is introduced to prevent
overlap of data and legend.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-22 16:33:39 +01:00
Adrian Schmutzler 00ba4ace1b routertools/filters/map.js: Implement babel cost by negative quality
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-22 16:31:58 +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 eb8822d79f statistics.html: Don't include orphans in gateway overview
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-22 16:26:13 +01:00
Adrian Schmutzler f8ba13268a routertools: Parse gateway quality differently to catch wrong data
Since old routers send defective gateway data, some routers got
values like "false6" for quality. This is now caught and false
removed.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-22 16:25:16 +01:00
Adrian Schmutzler 7091cc5054 Don't show "Blocked" status for V2 routers
This affects only whether the status indication is SHOWN. It does
not affect the storage of this tag.

One can still en- or disable the blocked status of a V2 router via
the options menu.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-22 16:24:10 +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 6d735a549a Changelog: Update
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-02 13:32:26 +01:00
Adrian Schmutzler 17f5c18a92 api/routers: Use MAC address for link to router
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-02-02 13:32:05 +01:00
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