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>
This suppresses hood change events if hood is lost due to
disconnection.
Normally, disconnects should be indicated by other events like
online/offline.
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
To get rid of V2 <-> V1 hood changes, an empty hood element is
treated as V2, while a missing one is treated as V1.
This requires a firmware update to work.
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
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>
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>
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>
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 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>
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>
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>
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>
This only works for routers with updated nodewatcher.
This requires changes to the MySQL database!
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>
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>
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>
This only works for routers with updated nodewatcher.
This requires changes to the MySQL database!
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
If routers are supposed to be removed from the Monitoring
permanently, they can now be banned based on their MAC address.
All admins can do that via the web interface.
ATTENTION: This requires a database update!
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
It is easier to evaluate a specific log which is not crowded with
messages from other programs
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>