Instead of waiting for interface to be up,
wait for it to have IPs, as this is what we need.
Also do not call procd_open_instance when not ready.
Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
(cherry picked from commit 1dd46bca62)
Not every radio has also ubus support. Only query radios with ubus
functions.
Signed-off-by: Nick Hainke <vincent@systemli.org>
[fixup, call ubus.connect() once per scrape]
Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
(cherry picked from commit 0a07237514)
listen_ipv6 config option is removed and we now
listen on both ipv4 and ipv6 addresses.
HTTP keepalive is enabled and set to 70s by default.
With uhttpd-mod-lua there is a small change in behavior,
all code is loaded/parsed/executed once on startup as before,
but now each request is executed in his own fork, so we can't
keep a state between requests.
Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
(cherry picked from commit 60460f0046)
All current node_exporter netclass metrics will be available. This includes
speed metrics per lan port on supported DSA switches.
Signed-off-by: René Treffer <treffer@measite.de>
(cherry picked from commit a315c40b72)
It is costly in transmissions to add all information to each metric.
Instead, only use the "device" as a label and add all other important
labels to the "uptime" metric.
Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit 9f3064a11c)
Ubnt-manager-collector collects statistics from airos devices configured
in ubnt-manager.
Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit 76f27975a9)
We previously did not identify the correct BSS from the output of
`hostapd_cli -i <phy> status`, because when asked for a vif it will
always respond with information relevant to the whole phy.
The per vif settings will use an iterator and we now try to detect
the correct BSS from that output.
Signed-off-by: Martin Weinelt <hexa@darmstadt.ccc.de>
To allow cross matching bssids between different exporters we need to
use the same case, as label matching is case senstive.
Signed-off-by: Martin Weinelt <hexa@darmstadt.ccc.de>
There was a corner case, when a vif had no stations, that
evaluate_metrics for a station that was nil and had no collected metrics
would have been called.
Comment the code, to make it easier to understand and follow, and
simplify some variable names along the way.
Signed-off-by: Martin Weinelt <hexa@darmstadt.ccc.de>
Normalizes metrics according to the Prometheus upstream metric
guidelines available at https://prometheus.io/docs/practices/naming/.
Drops the `hostapd_station_wpa` metric, because it is misleading, as it
is not a differentiator between WPA versions, like one could be led to
assume.
Exposes more flags in a more consistent manner. Their metric was
previously only exposed if the flag was present, but not if it wasn't.
The same applies issue was fixed with regards to vht caps.
After this commit the following breaking changes are in place:
- All flags have been moved below `hostapd_station_flags_$flagname`:
- `hostapd_station_ht` is now `hostapd_station_flag_ht`
- `hostapd_station_mfp` is now `hostapd_station_flag_mfp`
- `hostapd_station_vht` is now `hostapd_station_flag_vht`
- `hostapd_station_wmm` is now `hostapd_station_flag_wmm`
- New flags have been exposed:
- `hostapd_station_flag_he` for high-efficency connections
- `hostapd_station_flag_short_preamble` for short preamble connections
- `hostapd_station_flag_auth` for authentication state
- `hostapd_station_flag_assoc` for association state
- Some metrics have had their unit normalized to the SI base unit or
embedded into the metrics name:
- `hostapd_station_inactive_msec` is now
`hostapd_station_inactive_seconds`, the value is still float64 and
as such has enough precision anyway, but becomes easier to reason
about
- `hostapd_station_connected_time` has been renamed to
`hostapd_station_connected_seconds_total` so the unit, as well as
the nature of the counter is reflected
- `hostapd_station_signal` now includes its unit and is therefore
named `hostapd_station_signal_dbm`
- The packet counter metrics have been normalized to what the node
exporter uses, so it is more in line with the defaults in the
Prometheus ecosystem:
- `hostapd_station_rx_packets` is now
`hostapd_station_receive_packets_total`
- `hostapd_station_rx_bytes` is now
`hostapd_station_receive_bytes_total`
- `hostapd_station_tx_packets` is now
`hostapd_station_transmit_packets_total`
- `hostapd_station_tx_bytes` is now
`hostapd_station_transmit_bytes_total`
Signed-off-by: Martin Weinelt <hexa@darmstadt.ccc.de>
An empty line has a name and value that is nil and setting a table
index to nil breaks metrics for every vif after the first one.
Signed-off-by: Martin Weinelt <hexa@darmstadt.ccc.de>
Correlating data is only possible when we have more metadata, this adds
a bunch of labels for each client, that will increase the depth of
dashboards yet to come.
In particular the changes in this commit are:
- renames the `ifname` label to `vif`
- adds `frequency`, `channel`, `bssid`, `ssid`, `encryption` and `mode`
Signed-off-by: Martin Weinelt <hexa@darmstadt.ccc.de>
The "get_wifi_interfaces" function is not returning the wifi interface
names. This causes the bug #14625.
Fix the "get_wifi_interfaces" function.
Signed-off-by: Nick Hainke <vincent@systemli.org>
If you want statistics about IPv6 you can use snmpv6 exporter.
Currently, the "/proc/net/snmp6" is existing but all values are
just "0".
To use this plugin you have to set
CONFIG_PROC_STRIPPED=n
I will find a way to enable the important ipv6 statistics by default.
Signed-off-by: Nick Hainke <vincent@systemli.org>
Fix "hostapd_ubus_stations.lua". The bit-lib that is imported and the
one specified as the dependency do not match. Use luabitop.
Signed-off-by: Nick Hainke <vincent@systemli.org>
There is already the hostapd_stations exporter, which uses
hostapd-utils (more precisely hostapd-cli) to get client statistics.
However, the ubus interface is permanently integrated under hostapd
in OpenWrt. So this exporter needs one dependency less.
For now it exports mainly the rrm statistics. Many people are
interested in what your device supports. The exporter provides
information about the radio-resource-managment extensions.
Signed-off-by: Nick Hainke <vincent@systemli.org>
Extract data from configuration file /etc/config/dhcp and create labels
{name, ip, mac, dns} via uci. Those labels are useful in order to craft
complex prometheus queries as replacing the MAC address to a custom
name. E.g.: wifi_station_signal_dbm * on (mac) group_left(name)
uci_dhcp_host or on (mac) label_replace(wifi_station_signal_dbm, "name",
"$1", "mac", "(.+)")
Signed-off-by: Gérondal Thibault <contact@tycale.be>
DAWN is a decentralized WiFi Controller.
https://github.com/berlin-open-wireless-lab/DAWN
The node exporter allows to gather statistics about your network:
- Infos about AP (Channel Utilization, Station Count, ...)
- Connected Clients (Signal, Capabilities)
Signed-off-by: Nick Hainke <vincent@systemli.org>
The official node_exporter reports node_time_seconds as a gauge, but
prometheus-node-exporter-lua reports it as a counter. To be consistent
with the official implementation, and because "gauge" is more correct
than "counter" for this metric (system time can decrease, but the
Prometheus documentation states, "A counter is a cumulative metric that
represents a single monotonically increasing counter whose value can
only increase or be reset to zero on restart."), change the type for
node_time_seconds to "gauge".
Signed-off-by: Forest Crossman <cyrozap@gmail.com>
This exporter exposes information of the connected stations acquired
from hostapd. These contain additional information compared to the
existing station exporter, however they require a full build of hostapd
/ wpad.
Signed-off-by: David Bauer <mail@david-bauer.net>
This happens during compilation:
Enabling network
./etc/init.d/prometheus-node-exporter-lua: line 7: /lib/functions/network.sh: No such file or directory
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Drop the config knob 'listen_address' and introduce 'listen_interface'
and 'listen_ipv6' instead.
'listen_interface' takes an openwrt interface name ('loopback', 'lan',
'wan' etc, or "*" for all), from which the primary IP is used to listen
on. If 'listen_ipv6' is set to '1', the IPv6 adress will be used, IPv4
elsewise.
procd interface triggers are now combined with this, so if the listen
interface is not yet configured when the init script is executed, the
process start is defered, and the trigger takes care of that once
the interface is ready.
Fixes#7670
Signed-off-by: Andre Heider <a.heider@gmail.com>
To return the number of connected clients.
At present this can be partially inferred by using a count() over one of
the existing metrics, however this doesn't handle the case when there
are no connected clients. When that happens, the count() will return no
data instead of 0.
Signed-off-by: Alex Tomlins <alex@tomlins.org.uk>
These output a count of the number of packets transmitted/received, so
should be tracked as a counter. As it stands, promtool is warning that
these shouldn't be named ending _total if they're a gauge.
Signed-off-by: Alex Tomlins <alex@tomlins.org.uk>
If the /proc/sys/net/netfilter/nc_conntrack_* files are not present,
this exporter was outputting a blank value, which is invalid. These
files will not be present when using an image that doesn't include the
iptables and firewall packages (eg a minimal access-point type image).
This updates the collector to only output the metrics if the
corresponding /proc files are present.
Signed-off-by: Alex Tomlins <alex@tomlins.org.uk>
Prometheus introduced some new conventions on how to name metrics.
Read here https://prometheus.io/docs/practices/naming/
This PR breaks compatibility with past versions, just like the officials
node exporter! 💥
Signed-off-by: Paul Spooren <mail@aparcar.org>
Some releases may have non letters in it's name currently resulting in
an empty ("") output which is then discarded, resulting in *missing*
labels in the metric.
Now it uses `.-` to catch as little as possible, but anything.
Signed-off-by: Paul Spooren <mail@aparcar.org>
adds openwrt specific information about the device.
include DISTRIB_{ID, RELEASE, REVISION}, board_name and model
Example output:
# TYPE node_openwrt_info gauge
node_openwrt_info{revision="55a0636",model="QEMU Standard PC (i440FX + PIIX, 1996)",id="LiMe",board_name="qemu-standard-pc-i440fx-piix-1996",release="snapshot"} 1
node_scrape_collector_duration_seconds{collector="openwrt"} 3.814697265625e-05
node_scrape_collector_success{collector="openwrt"} 1
Signed-off-by: Paul Spooren <spooren@informatik.uni-leipzig.de>
Print all files from /var/prometheus/*.prom. This behaviour allow users
to add metrics with non-lua scripts.
Signed-off-by: Paul Spooren <spooren@informatik.uni-leipzig.de>
Now monitors as well the tunIn parameters, aka the annoucend routes to
the network. This is handy to check if a node annouces itself as a
gateway.
Also list all activated plugins.
Example output:
# TYPE bmx7_tunIn gauge
bmx7_tunIn{name="myIP4",network="10.198.52.86/32"} 1
bmx7_tunIn{name="myIP6",network="2012:0:0:56::/128"} 1
bmx7_tunIn{name="inet4",network="0.0.0.0/0"} 1
# TYPE bmx7_plugin gauge
bmx7_plugin{name="bmx7_config.so"} 1
bmx7_plugin{name="bmx7_json.so"} 1
bmx7_plugin{name="bmx7_sms.so"} 1
bmx7_plugin{name="bmx7_tun.so"} 1
Signed-off-by: Paul Spooren <spooren@informatik.uni-leipzig.de>
scrapes bmx6 status and connected links.
example output:
bmx6_status{id="qMp-LibreMesh-1706",version="BMX6-0.1-alpha",address="fd66:66:66:a:6670:2ff:fe3e:9d28"} 1
bmx6_link_rxRate{target="UPC-CN-C6-E104-Alix",source="qMp-LibreMesh-1706",dev="wlan0-mesh_12"} 100
bmx6_link_txRate{target="UPC-CN-C6-E104-Alix",source="qMp-LibreMesh-1706",dev="wlan0-mesh_12"} 100
bmx6_link_rxRate{target="UPC-CN-C6-E104-Alix-Paul",source="qMp-LibreMesh-1706",dev="wlan1-adhoc_12"} 100
bmx6_link_txRate{target="UPC-CN-C6-E104-Alix-Paul",source="qMp-LibreMesh-1706",dev="wlan1-adhoc_12"} 100
bmx6_link_rxRate{target="UPC-CN-C6-E104-Turoffner",source="qMp-LibreMesh-1706",dev="wlan0-mesh_12"} 97
bmx6_link_txRate{target="UPC-CN-C6-E104-Turoffner",source="qMp-LibreMesh-1706",dev="wlan0-mesh_12"} 100
node_scrape_collector_duration_seconds{collector="bmx6"} 0.0025260448455811
node_scrape_collector_success{collector="bmx6"} 1
scrapes bmx7 status and connected links.
example output:
bmx7_status{id="C68791D2",revision="3a52f89",name="smpl-18f4ce",address="fd70:c687:91d2:8ab3:1a88:6b14:bad0:2b18"} 1
bmx7_cpu_usage 0.7
bmx7_mem_usage 3204000
bmx7_link_rxRate{target="F48239CD",dev="wlan0-mesh_13",source="C68791D2",name="smpl-07889a"} 54000
bmx7_link_txRate{target="F48239CD",dev="wlan0-mesh_13",source="C68791D2",name="smpl-07889a"} 52729
node_scrape_collector_duration_seconds{collector="bmx7"} 0.0020999908447266
node_scrape_collector_success{collector="bmx7"} 1
prometheus-node-exporter-lua: bmx6/7 netjson format
adds labels called source and target to links instead of only the target
previously called "id".
Retrieving all *links* from prometheus now makes it easier to create
a valid netjson(.org) graph.
It's not feasible to use *instance* as *source* as for instance likely
the name is used for dns, instead of the ID. Using the *name* instead of
*id* for netjson linking results in a bad graph when two devices have
the same (default) hostname.
Signed-off-by: Paul Spooren <spooren@informatik.uni-leipzig.de>