The router id "router_id" is only evaluated based on the
router_netif table. If the corresponding entry in the router
table is missing, an error occurs.
To deal with that, we now use the "olddata" variable for ifs,
which is initialized based on the router table. If nothing is
found there, we trigger delete_router to get rid of fragments
in other tables.
The latter is necessary, as we identify routers by MAC addresses
and thus old entries will keep to be a problem if just a new
entry is added to router_netif.
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
This is much easier to maintain and prevents from having a
wrong average if e.g. w2mesh and w5mesh are present, but only
the better one is used.
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
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>
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>
This change the behavior concerning the displayed netif name in
the legend of the neighbor stats plot. Previously, the netif name
of the device was shown, now we show the netif name corresponding
to the neighbor. This is necessary, as we do not log netif names
for neighbors.
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
If a router is currently not connected as neighbor, we don't see
its history. This patch shows all current and former neighbors.
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
scripts/defragtables.py:
- If run without argument, all tables EXCEPT stats are defragmented
(quick run)
- If run with argument e.g. "1", all table INCLUDING stats are
defragmented (will take about one hour)
scripts/defragtable.py <space-separated list of tables>:
- Defragments the specified tables; will crash if table does not
exist
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
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>
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>
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>
Since events do not cost much, the number stored and displayed
is drastically increased.
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
This only works for routers with updated nodewatcher.
This requires changes to the MySQL database!
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>