Commit Graph

52 Commits

Author SHA1 Message Date
Adrian Schmutzler 98af250294 api/get_routers_by_keyxchange_id: Switch to V2
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2019-05-11 23:52:04 +02:00
Adrian Schmutzler b8409d3abe api/alfred and api/alfred2: Return status also when error occurs
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2019-05-11 23:49:56 +02:00
Adrian Schmutzler 103a404eea api/alfred2: Introduce alfred mode WITHOUT fetch_id
Read alfred data without surrounding {"64":"<data>"},
so just <data> can be sent.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2019-05-11 23:49:31 +02:00
Adrian Schmutzler 339122bc0c api: Merge code for different node lists
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 74ba799912 alfred/gwinfo: Provide specific error message if JSON non-parsable
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-11-23 13:14:50 +01:00
Adrian Schmutzler c1c728f2a3 Global: Convert IPv4/IPv6 from char to numbers/binary
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>
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 166cad518a map/router.html: Indicate ethernet mesh connections by color
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2018-07-03 13:49:41 +02:00
Adrian Schmutzler 54764f7f43 router.html: Show former neighbors in neighbor stats plot
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>
2018-04-16 13:18:22 +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 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 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 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 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 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 55dc7b4ad5 Rename net_if from router_neighbor table to netif
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>
2017-12-30 18:21:08 +01:00
Adrian Schmutzler 58ce32e322 Change router_stats_netif to use ids for netifs
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>
2017-12-30 17:18:22 +01:00
Adrian Schmutzler ec66c05361 api/nodelist: Fix condition for coordinates
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 17:15:54 +01:00
Adrian Schmutzler 71bb5a3a68 map: Show router popup only for selected layer
If KeyXchange v1 routers are not shown, their popup windows are
now also disabled (as the user would expect); same for v2.

Fixes #95.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-30 17:12:12 +01:00
Adrian Schmutzler 20e71afeb0 Provide possibility to ban routers
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>
2017-12-21 17:03:27 +01:00
Adrian Schmutzler 818dc79b7d api/alfred: Remove old comments
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-21 16:44:07 +01:00
Adrian Schmutzler ae3b065f63 api/alfred: Fix alignment of mysql.close()
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-21 16:43:52 +01:00
Adrian Schmutzler 41ef7f281a api.py/application.py: Write extended information to full log
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-10 20:25:16 +01:00
Adrian Schmutzler 4fa16a738a api/alfred: Get IP address of alfred senders
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-10 19:41:59 +01:00
Adrian Schmutzler d0d173d935 Introduce debugging function
This adds a timestamp to all debug outputs

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-11-23 22:02:27 +01:00
Adrian Schmutzler 58b6bc34f9 helpers/api: Fix MAC search
This fixes searching for MAC addresses in the router list and
via api/get_router_by_mac/

Additionally, regex is enabled for MAC addresses.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-11-19 15:41:19 +01:00
Adrian Schmutzler b2541fe40e api/alfred: Write time and duration of alfred calls to file
Attention: This contains a hardcoded path!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-11-19 15:40:08 +01:00
Adrian Schmutzler af545d8194 config: Introduce path for debug output
Includes update of file names for debug files.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-11-19 15:36:43 +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 6f61cc6fdc Optimize MySQL commit for /api/alfred plus some debugging
Signed-off-by: Adrian Schmutzler <adsc@monitoring.freifunk-franken.de>
2017-11-16 20:40:45 +01:00
Adrian Schmutzler 8dc3633246 Fix missing timezone awareness of immutable data types
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-11-16 15:05:24 +01:00
Adrian Schmutzler a65873c2ee Global stats put into separate scripts and run by cron
Most of the processes is executed every five minutes, but
deleting can be done only once per day ...

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-11-16 15:00:12 +01:00
Adrian Schmutzler 412203a946 api: Add wifianalall (all hoods)
Puts reused code into a helper function

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-11-16 00:01:01 +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 f8c5913ad1 Commit unstaged changes from production instance 2017-08-21 11:49:26 +02:00
Adrian Schmutzler b013533dfe Add API script to output JSON list of routers with MAC address
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-08-18 14:38:57 +02:00
Dominik Heidler 8f7a55042a Fix code style 2017-08-18 14:24:20 +02:00
Adrian Schmutzler 5f65d38908 Add WifiAnalyzer alias file output
Syntax: /api/wifianal/<hood>

This returns raw text.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>

Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-08-18 13:20:47 +02:00
Adrian Schmutzler 2a3cd94619 Harmonize tab style in api.py
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-08-17 23:36:06 +02:00
Steffen Pankratz 0ef01992ed Added nodelist API endpoint.
Signed-off-by: Steffen Pankratz <kratz00@gmx.de>
2016-05-03 22:24:34 +02:00
Dominik Heidler af2a80f5ee Delete routers with last_contact > 100 days ago 2016-03-10 13:55:15 +01:00
Dominik Heidler 4cddcbfec3 Fix MAC Address redirect 2016-02-06 11:42:11 +01:00
Dominik Heidler 4984d614e7 Implement /get_router_by_mac/<mac>
- To allow hotlink from router webui
- Will redirect to router page when there is
  exactly one router with this mac
- Otherwise redirect to router list with mac
  set as filter
2016-01-25 16:49:14 +01:00
Dominik Heidler 6c385b3408 add statistics page 2015-11-11 15:27:50 +01:00