Commit Graph

59 Commits

Author SHA1 Message Date
Andre Heider b19da2d419 prometheus-node-exporter-lua: add missing metrics to ltq-dsl
Two values were missing, add them to the appropriate metrics.

The dsl error vectors are new and useful stats to debug vector related
line deteriorations, see [0].

[0] https://forum.openwrt.org/t/vectoring-on-lantiq-vrx200-vr9-missing-callback-for-sending-error-samples/104046

Signed-off-by: Andre Heider <a.heider@gmail.com>
2021-11-02 02:49:21 -04:00
Martin Weinelt 093f3443ce prometheus-node-exporter-lua: fix broken control flow
Signed-off-by: Martin Weinelt <hexa@darmstadt.ccc.de>
2021-09-24 18:10:25 -04:00
Martin Weinelt 2849ec248d prometheus-node-exporter-lua: fix bss identifier in hostapd_stations
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>
2021-07-24 17:44:14 +02:00
Martin Weinelt df446adc24 prometheus-node-exporter-lua: Bump PKG_RELEASE
Signed-off-by: Martin Weinelt <hexa@darmstadt.ccc.de>
2021-07-06 13:37:36 -04:00
Martin Weinelt 445d8927f6 prometheus-node-exporter-lua: lower case bssid label value in wifi exporter
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>
2021-07-06 13:37:36 -04:00
Martin Weinelt a1b145abb0 prometheus-node-exporter-lua: fix corner case in hostapd_stations
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>
2021-07-06 13:37:36 -04:00
Martin Weinelt a98596168a prometheus-node-exporter-lua: normalize metric names in hostapd_stations
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>
2021-07-06 13:37:36 -04:00
Martin Weinelt 0a9d2b818d prometheus-node-exporter-lua: handle empty lines in all_sta output correctly
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>
2021-07-06 13:37:36 -04:00
Martin Weinelt 6d85547f24 prometheus-node-exporter-lua: increase label density in hostapd_stations
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>
2021-07-06 13:37:36 -04:00
Kevin Lyda 4028878b2b prometheus-node-export-lua: add my email
Add my email address to the copyright for the file.

Signed-off-by: Kevin Lyda <kevin@lyda.ie>
2021-06-13 16:10:57 -04:00
Nick Hainke 495cdbb39d prometheus-node-exporter-lua: fix wifi
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>
2021-02-15 08:39:09 -05:00
Andre Heider 43c0f0486e prometheus-node-exporter-lua: use the new ubus dsl metrics
This is significantly faster.

Signed-off-by: Andre Heider <a.heider@gmail.com>
2021-02-04 06:14:37 +01:00
Nick Hainke 1ead520e0d prometheus-node-exporter-lua: update netstat
The snmp and netstat interface are enabled by default
See: 4943bc5cff47a482c3010033e04c6d489a4b733c

Signed-off-by: Nick Hainke <vincent@systemli.org>
2021-01-28 23:56:35 +01:00
Nick Hainke 77188d2422 prometheus-node-exporter-lua: add snmp6 exporter
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>
2020-12-07 18:31:57 +01:00
Nick Hainke 2bc32a7078 prometheus-node-exporter-lua: fix hostapd exporter
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>
2020-10-29 18:52:33 +01:00
Nick Hainke d34d788735 prometheus-node-exporter-lua: hostad ubus stats
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>
2020-10-12 19:51:38 +02:00
Nick Hainke 8dfd1bc59a prometheus-node-exporter-lua: update dawn exporter
Add dawn exporter to Makefile.
Add hostname to export.

Signed-off-by: Nick Hainke <vincent@systemli.org>
2020-10-07 13:54:23 +02:00
Gérondal Thibault 5d42bf7550 prometheus-node-exporter-lua: Makefile alphabetical ordering
Signed-off-by: Gérondal Thibault <contact@tycale.be>
2020-07-20 13:11:04 -10:00
Gérondal Thibault e2b3fec6bf prometheus-node-exporter-lua: uci_dhcp_host module
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>
2020-07-20 13:11:04 -10:00
Nick Hainke c8d1a3b60c prometheus-node-exporter-lua: add dawn exporter
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>
2020-06-26 15:20:03 +02:00
Forest Crossman 850c8dc141 prometheus-node-exporter-lua: Change node_time_seconds type to "gauge"
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>
2020-05-03 15:16:14 -05:00
David Bauer af8f8f8046 prometheus-node-exporter-lua: add hostapd exporter
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>
2020-02-03 15:42:35 +01:00
Rosen Penev 3aa009478a
prometheus-node-exporter-lua: fixed small warning
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>
2020-01-27 18:55:31 -08:00
Etienne Champetier 50b825e7fa prometheus-node-exporter-lua: bump version
Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
2019-11-17 18:16:48 -08:00
Zoltan Haindrich 7bec619f53 prometheus-node-exporter-lua: an unavaliable wifi interface may have stopped the scraper from functioning
Signed-off-by: Zoltan Haindrich <kirk@rxd.hu>
2019-11-17 18:16:48 -08:00
Andre Heider a3af4c3691 prometheus-node-exporter-lua: respawn the process
Signed-off-by: Andre Heider <a.heider@gmail.com>
2019-11-17 18:16:48 -08:00
Andre Heider d8e637d064 prometheus-node-exporter-lua: add a config reload trigger
Signed-off-by: Andre Heider <a.heider@gmail.com>
2019-11-17 18:16:48 -08:00
Andre Heider 48568ad9f9 prometheus-node-exporter-lua: switch config to openwrt interface names
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>
2019-11-17 18:16:48 -08:00
Martin Schiller 0b34b8538e prometheus-node-exporter-lua: ltq-dsl.lua: use new var names errors_fecs_*
Signed-off-by: Martin Schiller <ms@dev.tdt.de>
2019-09-23 06:38:25 +02:00
Etienne Champetier a14bed1bc9 prometheus-node-exporter-lua: add target & system to OpenWrt collector
Before:
node_openwrt_info{revision="r10756+1-7546be6007",model="GL.iNet GL-AR150",id="OpenWrt",board_name="glinet,gl-ar150",release="SNAPSHOT"} 1

After:
node_openwrt_info{revision="r10756+1-7546be6007",target="ath79/generic",board_name="glinet,gl-ar150",id="OpenWrt",model="GL.iNet GL-AR150",release="SNAPSHOT",system="Atheros AR9330 rev 1"} 1

Fixes #9730, replace #9735

Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
2019-08-14 20:52:30 -07:00
Kirill Lukonin 5eb8e47df2 prometheus-node-exporter-lua: Add more wifi_station metrics and fix naming according to original wifi_linux.go node exporter
Signed-off-by: Kirill Lukonin <klukonin@gmail.com>
2019-04-15 12:51:11 +05:00
Alex Tomlins 4b6f76bfac prometheus-node-exporter-lua: Bump PKG_RELEASE
Signed-off-by: Alex Tomlins <alex@tomlins.org.uk>
2019-04-08 19:52:32 +01:00
Alex Tomlins 1237e196b4 prometheus-node-exporter-lua: Add wifi_station_count
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>
2019-04-08 19:39:34 +01:00
Alex Tomlins a45c702baa prometheus-node-exporter-lua: wifi packets should be a counter
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>
2019-04-08 19:39:34 +01:00
Alex Tomlins deab22044b prometheus-node-exporter-lua: Bump PKG_RELEASE
Signed-off-by: Alex Tomlins <alex@tomlins.org.uk>
2019-04-04 22:28:40 +01:00
Alex Tomlins 0100a2cb26 prometheus-node-exporter-lua: fix missing conntrack values
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>
2019-04-03 21:08:11 +01:00
Piotr Machała 626b197cc1 prometheus-node-exporter-lua: change network metric type to counter
Signed-off-by: Piotr Machała <pm7gt@933x.net>
2018-12-30 22:11:25 +01:00
Rene Treffer c751af8616 prometheus-node-exporter-lua: add lantiq dsl modem collector
a.heider: Address PR comments and clean up.

Signed-off-by: Rene Treffer <treffer+github@measite.de>
Signed-off-by: Andre Heider <a.heider@gmail.com>
2018-12-16 19:17:00 +01:00
Leonid Evdokimov 1288bd6473 prometheus-node-exporter-lua: close io.popen files to reap zombies
Signed-off-by: Leonid Evdokimov <leon@darkk.net.ru>
2018-11-25 17:06:24 +03:00
Etienne Champetier b584443d65 prometheus-node-exporter-lua: add conntrack collector
Also fix missing dependency of openwrt collector

Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
2018-07-25 23:23:56 +02:00
Etienne Champetier 767f87f469 prometheus-node-exporter-lua: set myself as maintainer
This was OKed sometimes ago by @simonswine
https://github.com/openwrt/packages/pull/5128

Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
2018-07-25 23:21:38 +02:00
Paul Spooren de9f3656c7 prometheus-node-exporter-lua: adapt 0.16 metrics
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>
2018-06-28 23:53:12 +09:00
Paul Spooren fc44f87dc5 prometheus-node-exporter-lua: handle fancy release
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>
2018-06-17 17:07:36 +09:00
Paul Spooren 053487cca7 prometheus-node-exporter-lua: add openwrt exporter
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>
2018-05-05 21:15:48 +09:00
Paul Spooren 509f208ee7 prometheus-node-exporter-lua: export static files
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>
2018-04-30 01:17:20 +09:00
Paul Spooren 79073ee201 prometheus-node-exporter-lua: extend bmx7 plugin
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>
2018-04-14 15:58:52 +09:00
Paul Spooren f7093021f9 prometheus-node-exporter-lua: add bmx6/7 scraper
scrapes bmx6 status and connected links.

example output:

    bmx6_status{id="qMp-LibreMesh-1706",version="BMX6-0.1-alpha",address="fd66:66:66🅰️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>
2018-02-12 21:41:37 +01:00
Etienne Champetier d1b461137a prometheus-node-exporter-lua: bump version
Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
2017-12-08 21:22:16 -08:00
Etienne Champetier ea5b7492fe prometheus-node-exporter-lua: rework cpu collector
replace 2 string.match and 1 string.gmatch (space_split)
by 1 string.match

Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
2017-12-08 21:22:16 -08:00
Etienne Champetier ed7d60d871 prometheus-node-exporter-lua: use io.lines(), remove line_split
Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
2017-12-08 21:22:16 -08:00