Compare commits
6 Commits
5728762dbe
...
830f99036f
Author | SHA1 | Date |
---|---|---|
Gregor Michels | 830f99036f | |
Gregor Michels | 87d2b0e690 | |
Gregor Michels | 90e231d371 | |
Gregor Michels | ba014a64d0 | |
Gregor Michels | 7b223d7053 | |
Gregor Michels | 735a07c842 |
|
@ -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
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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.
|
@ -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
|
||||
|
||||
|
|
Reference in New Issue