Commit Graph

36 Commits

Author SHA1 Message Date
Adrian Schmutzler f26f01f73c statistics.html/gws.html: Show gwinfo version of gateways
This requires changes to the MySQL database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2019-05-11 23:49:14 +02:00
Adrian Schmutzler 4c2b4f1628 gateways: Add new page with gateway data (IPs, DHCP ranges)
Shows all interfaces without checking vpnif.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-11-23 13:14:51 +01:00
Adrian Schmutzler f14e9a51be statistics.html: Fix order in hoods table
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-11-23 13:14:51 +01:00
Adrian Schmutzler 0bf2312fe4 Global: Put hoods into table and use smallint for reference
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>
2018-11-23 13:14:50 +01:00
Adrian Schmutzler dd6d101ccd Global: Identify local routers and indicate their status
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>
2018-11-23 13:14:50 +01:00
Adrian Schmutzler bc3460f2e0 Global: Change MAC address storage to use BIGINT
This requires changes to the MySQL database!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-11-23 13:14:41 +01:00
Adrian Schmutzler 478c0fb8dd gwinfo: Support internal IPv4/IPv6 and DHCP ranges (v1.4)
This updates gwinfo script AND evaluation code.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-11-22 18:37:30 +01:00
Adrian Schmutzler 05fda04ccd user_list: Fix not counting router for mixed-case mail adresses
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-11-22 18:31:44 +01:00
Adrian Schmutzler aa99035e23 statistics.html: Show aggregated traffic for hoods and total
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>
2018-07-03 13:45:40 +02:00
Adrian Schmutzler af2e2591b9 statistics.html: Show "models per client" pie chart
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-04-16 13:12:03 +02: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 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 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 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 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 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 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 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 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 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
Adrian Schmutzler a994ec114a MySQL stats: Convert from datetime to int
DB scripts still need to be updated.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-10 19:49:46 +01:00
Adrian Schmutzler 5e75f9cad0 config: Move config to a single, separate file
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-11-19 15:30:39 +01:00
Adrian Schmutzler 3fd731a5a2 Introduced orphaned state between offline and deletion
After 7 days of being offline, a router enters the orphaned
state with a grey icon. It is only deleted after a longer period
of 180 days.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-11-16 20:41:38 +01:00
Adrian Schmutzler 9d167bdb86 Respect case in database and code
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-11-16 00:06:25 +01:00
Adrian Schmutzler 003fcbcebe routertools/stattools: Implement default hood as str "Default"
If the default is NULL (as previously), we have ugly problems
with indexing and queries. To circumvent this, the hood is
set to "Default" right at the beginning.

For old data, we add an if to the hood stats calculation.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-11-16 00:05:48 +01:00
Adrian Schmutzler 87093a9066 Add hood-specific statistics
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-11-16 00:00:48 +01:00
Adrian Schmutzler e3fe995407 MySQL: alpha3
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-11-16 00:00:07 +01:00
Dominik Heidler 7921ac6d90 Move datetime.utcnow().replace(tz... into function 2016-03-10 14:22:23 +01:00
Dominik Heidler 19329ef85c User Accounts, Legacy Routers, Delete Routers 2016-02-29 18:51:58 +01:00
Dominik Heidler c34246f3a8 Let MongoClient be tz_aware
- output datetime objects from mongodb are now tz_aware with tzinfo=utc
- fixes #11
2016-02-15 18:51:40 +01:00
Dominik Heidler b19335d3f8 fix hood updater and add hw name normalizer 2015-11-27 15:58:35 +01:00
Dominik Heidler 6c385b3408 add statistics page 2015-11-11 15:27:50 +01:00