[feature] OpenWRT: extract associated WiFi stations

未关闭
#66 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
功能
描述清晰度
需要澄清
活跃度
停滞
技术栈
python, shell

调研方向

检查 /tmp/test 和 /etc/config/snmpd 中提议的 OpenWRT 入口点,以及 iw、iwinfo、ubus、jsonfilter 和 netjson-monitoring 的客户端数据。定义一种提取关联 WiFi 站点和所列客户端字段的方法;完成的标准是能够通过项目基于 SNMP 的设备抽象获取这些信息。

由索引模型根据 Issue 内容生成。

描述

enhancement

This is one of the pieces of information in which openwisp users are mostly interested since it's widely used in public WiFi networks.

We can get this information with additional scripts and a custom MIB.
We could use iw or ubus (as we do in netjson-monitoring).
If we get a good result we could even send a patch to include these scripts in net-snmpd on OpenWRT by default.

Example exec net-snmpd script on on OpenWRT:

in /tmp/test:

#!/bin/sh
iwinfo

in /etc/config/snmpd:

config exec 'iwinfo'       
  option name 'iwinfo'
  option prog '/tmp/test' 
  option miboid '1.2.3.4'  

Output:

snmpwalk -v2c -c public <ip> 1.2.3.4
iso.2.3.4.1.1 = INTEGER: 1
iso.2.3.4.2.1 = STRING: "yo"
iso.2.3.4.3.1 = STRING: "/tmp/test"
iso.2.3.4.100.1 = INTEGER: 0
iso.2.3.4.101.1 = STRING: "wlan1     ESSID: \"fvgwifi-demo\""
iso.2.3.4.101.2 = STRING: "          Access Point: 46:D1:FA:4B:38:42"
iso.2.3.4.101.3 = STRING: "          Mode: Master  Channel: 1 (2.412 GHz)"
iso.2.3.4.101.4 = STRING: "          Tx-Power: 20 dBm  Link Quality: unknown/70"
iso.2.3.4.101.5 = STRING: "          Signal: unknown  Noise: -92 dBm"
iso.2.3.4.101.6 = STRING: "          Bit Rate: unknown"
iso.2.3.4.101.7 = STRING: "          Encryption: none"
iso.2.3.4.101.8 = STRING: "          Type: nl80211  HW Mode(s): 802.11bgn"
iso.2.3.4.101.9 = STRING: "          Hardware: unknown [Generic MAC80211]"
iso.2.3.4.101.10 = STRING: "          TX power offset: unknown"
iso.2.3.4.101.11 = STRING: "          Frequency offset: unknown"
iso.2.3.4.101.12 = STRING: "          Supports VAPs: yes  PHY name: phy1"
iso.2.3.4.101.13 = ""
iso.2.3.4.101.14 = STRING: "wlo1      ESSID: \"broadgee-backup\""
iso.2.3.4.101.15 = STRING: "          Access Point: 44:D1:FA:4B:38:42"
iso.2.3.4.101.16 = STRING: "          Mode: Master  Channel: 1 (2.412 GHz)"
iso.2.3.4.101.17 = STRING: "          Tx-Power: 20 dBm  Link Quality: 62/70"
iso.2.3.4.101.18 = STRING: "          Signal: -48 dBm  Noise: -92 dBm"
iso.2.3.4.101.19 = STRING: "          Bit Rate: 36.1 MBit/s"
iso.2.3.4.101.20 = STRING: "          Encryption: WPA2 PSK (CCMP)"
iso.2.3.4.101.21 = STRING: "          Type: nl80211  HW Mode(s): 802.11bgn"
iso.2.3.4.101.22 = STRING: "          Hardware: unknown [Generic MAC80211]"
iso.2.3.4.101.23 = STRING: "          TX power offset: unknown"
iso.2.3.4.101.24 = STRING: "          Frequency offset: unknown"
iso.2.3.4.101.25 = STRING: "          Supports VAPs: yes  PHY name: phy1"
iso.2.3.4.101.26 = ""
iso.2.3.4.102.1 = INTEGER: 0
iso.2.3.4.103.1 = ""

Of course the example above is naive but just explains how to get additional info on OpenWRT via SNMPd.

The important info we currently get from netjson-monitoring is:

"channel": 1,
"country": "IT",
"frequency": 2412,
"mode": "access_point",
"noise": -93,
"signal": -54,
"ssid": "SSID name",
"tx_power": 20,
"clients": [
    {
        "aid": 1,
        "assoc": true,
        "auth": true,
        "authorized": true,
        "ht": true,
        "mac": "<MACADDR>",
        "mfp": false,
        "preauth": false,
        "vht": false,
        "wds": false,
        "wmm": true,
        "wps": false
    }
]

I think we can get this info with a mixture of commands like uci get, iwinfo, iw <interface> station dumpor via ubus and jsonfilter.

We can work on this idea once we complete the first release.

主要语言
Python
星标
42
派生
18
平均合并
8 小时
30 天内合并 PR
4

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

openwisp/netengine 的其他 Issue

查看 openwisp/netengine 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。