Compare commits

...

6 Commits

Author SHA1 Message Date
Gregor Michels 830f99036f pass: add entry for gigacube-E950 2022-07-28 02:19:33 +02:00
Gregor Michels 87d2b0e690 doc - OVERVIEW: add info regarding gigacube 2022-07-28 02:16:29 +02:00
Gregor Michels 90e231d371 accesspoints: add wifi clients metrics into prometheus
`wifi_network_clients` exposes the amount of connected wifi clients
2022-07-25 02:26:54 +02:00
Gregor Michels ba014a64d0 wifi.lua: add wifi_clients metric 2022-07-25 02:00:56 +02:00
Gregor Michels 7b223d7053 add vanilla wifi.lua
from `prometheus-node-exporter-lua-wifi` package
2022-07-25 01:59:52 +02:00
Gregor Michels 735a07c842 venv: upgrade to ansible 6.1.0 2022-07-24 17:09:57 +02:00
5 changed files with 82 additions and 20 deletions

View File

@ -1,13 +1,14 @@
ansible==6.0.0
ansible-core==2.13.1
ansible==6.1.0
ansible-core==2.13.2
certifi==2022.6.15
cffi==1.15.1
charset-normalizer==2.1.0
cryptography==37.0.2
cryptography==37.0.4
idna==3.3
Jinja2==3.1.2
MarkupSafe==2.1.1
packaging==21.3
pkg_resources==0.0.0
proxmoxer==1.3.1
pycparser==2.21
pyparsing==3.0.9
@ -15,4 +16,4 @@ PySocks==1.7.1
PyYAML==6.0
requests==2.28.1
resolvelib==0.8.1
urllib3==1.26.9
urllib3==1.26.10

View File

@ -9,19 +9,20 @@ Diagram:
IPAM / Device Overview:
-----------------------
| Name | Location | MGMT IPv4 | MAC | Device | Notes |
| -------------- | --------- | ------------ | ------------------- | -------------------- | ----- |
| `gw-core01` | Büro | `10.84.1.1` | `78:8a:20:bd:b6:ae` | Ubiquiti EdgeRouterX | |
| `sw-access01` | Büro | `10.84.1.11` | `bc:cf:4f:e3:bb:8d` | Zyxel GS1800-8HP | |
| `sw-access02` | Zelt 5 | `10.84.1.12` | `bc:cf:4f:e3:ac:39` | Zyxel GS1800-8HP | |
| `hyper01` | Büro | `10.84.1.21` | `00:23:24:54:f0:fe` | Lenovo ThinkCentre ? | |
| `monitoring01` | `hyper01` | `10.84.1.51` | `16:b9:13:c3:10:5e` | Proxmox VM | |
| `ap-2bbf` | Zelt 4 | `10.84.1.30` | `24:de:c6:cc:2b:bf` | Aruba AP-105 | |
| `ap-1a38` | Zelt 5 | `10.84.1.35` | `24:de:c6:c3:ac:7c` | Aruba AP-105 | |
| `ap-0b99` | Zelt 2 | `10.84.1.32` | `6c:f3:7f:c9:0b:99` | Aruba AP-105 | |
| `ap-c5d1` | Büro | `10.84.1.33` | `ac:a3:1e:cf:c5:d1` | Aruba AP-105 | |
| `ap-c495` | Zelt 3 | `10.84.1.34` | `ac:a3:1e:cf:c4:95` | Aruba AP-105 | |
| `ap-8f42` | Zelt 1 | `10.84.1.36` | `d8:c7:c8:c2:8f:42` | Aruba AP-105 | |
| Name | Location | MGMT IPv4 | MAC | Device | Notes |
| --------------- | --------- | ------------- | ------------------- | -------------------- | ------------------------------------------------- |
| `gigacube-E950` | Büro | `192.168.0.1` | `c8:ea:f8:b6:e9:50` | ZTE MF289F/Gigacube | property of Saxonia Catering/rental from Vodafone |
| `gw-core01` | Büro | `10.84.1.1` | `78:8a:20:bd:b6:ae` | Ubiquiti EdgeRouterX | |
| `sw-access01` | Büro | `10.84.1.11` | `bc:cf:4f:e3:bb:8d` | Zyxel GS1800-8HP | |
| `sw-access02` | Zelt 5 | `10.84.1.12` | `bc:cf:4f:e3:ac:39` | Zyxel GS1800-8HP | |
| `hyper01` | Büro | `10.84.1.21` | `00:23:24:54:f0:fe` | Lenovo ThinkCentre ? | |
| `monitoring01` | `hyper01` | `10.84.1.51` | `16:b9:13:c3:10:5e` | Proxmox VM | |
| `ap-2bbf` | Zelt 4 | `10.84.1.30` | `24:de:c6:cc:2b:bf` | Aruba AP-105 | |
| `ap-1a38` | Zelt 5 | `10.84.1.35` | `24:de:c6:c3:ac:7c` | Aruba AP-105 | |
| `ap-0b99` | Zelt 2 | `10.84.1.32` | `6c:f3:7f:c9:0b:99` | Aruba AP-105 | |
| `ap-c5d1` | Büro | `10.84.1.33` | `ac:a3:1e:cf:c5:d1` | Aruba AP-105 | |
| `ap-c495` | Zelt 3 | `10.84.1.34` | `ac:a3:1e:cf:c4:95` | Aruba AP-105 | |
| `ap-8f42` | Zelt 1 | `10.84.1.36` | `d8:c7:c8:c2:8f:42` | Aruba AP-105 | |
Cloud VMs:
----------
@ -38,7 +39,7 @@ Networks:
| ---------- | ---- | ----------------- | -------- | --------------------------------------------------------------------- |
| `mgmt` | 1 | `10.84.1.0/24` | / | default network which is used for administrative and monitoring tasks |
| `clients` | 2 | `10.84.2.0/22` | / | this is where the wifi clients live |
| `gigacube` | / | `192.168.8.0/24` | / | created by the gigacube. wan for our gateway |
| `wan` | 3 | `192.168.0.0/24` | / | created by the gigacube. wan for our gateway |
| `backbone` | / | `10.84.254.0/30` | / | tunnel network between `gw-core01` and `eae-adp-jump01` |
WiFi Networks:

50
files/wifi.lua Executable file
View File

@ -0,0 +1,50 @@
local ubus = require "ubus"
local iwinfo = require "iwinfo"
local function scrape()
local metric_wifi_network_quality = metric("wifi_network_quality","gauge")
local metric_wifi_network_bitrate = metric("wifi_network_bitrate","gauge")
local metric_wifi_network_noise = metric("wifi_network_noise_dbm","gauge")
local metric_wifi_network_signal = metric("wifi_network_signal_dbm","gauge")
local metric_wifi_clients = metric("wifi_network_clients", "gauge")
local u = ubus.connect()
local status = u:call("network.wireless", "status", {})
for dev, dev_table in pairs(status) do
for _, intf in ipairs(dev_table['interfaces']) do
local ifname = intf['ifname']
if ifname ~= nil then
local iw = iwinfo[iwinfo.type(ifname)]
local labels = {
channel = iw.channel(ifname),
ssid = iw.ssid(ifname),
bssid = iw.bssid(ifname),
mode = iw.mode(ifname),
ifname = ifname,
country = iw.country(ifname),
frequency = iw.frequency(ifname),
device = dev,
}
local qc = iw.quality(ifname) or 0
local qm = iw.quality_max(ifname) or 0
local quality = 0
if qc > 0 and qm > 0 then
quality = math.floor((100 / qm) * qc)
end
local wifi_clients = 0
for _ in pairs(iw.assoclist(ifname)) do wifi_clients = wifi_clients +1 end
metric_wifi_network_quality(labels, quality)
metric_wifi_network_noise(labels, iw.noise(ifname) or 0)
metric_wifi_network_bitrate(labels, iw.bitrate(ifname) or 0)
metric_wifi_network_signal(labels, iw.signal(ifname) or -255)
metric_wifi_clients(labels, wifi_clients)
end
end
end
end
return { scrape = scrape }

Binary file not shown.

View File

@ -32,10 +32,20 @@
notify:
- restart prometheus-node-exporter-lua
- name: install prometheus-node-exporter-lua-wifi
- name: uninstall vanilla prometheus-node-exporter-lua-wifi
opkg:
name: prometheus-node-exporter-lua-wifi
update_cache: yes
state: absent
notify:
- restart prometheus-node-exporter-lua
- name: install custom prometheus-node-exporter-lua-wifi
copy:
src: files/wifi.lua
dest: /usr/lib/lua/prometheus-collectors/wifi.lua
owner: root
group: root
mode: 0755
notify:
- restart prometheus-node-exporter-lua