Commit Graph

77 Commits

Author SHA1 Message Date
Ivan Mironov 41975220c0 prometheus-node-exporter-lua: bump package version
Signed-off-by: Ivan Mironov <mironov.ivan@gmail.com>
2023-10-15 11:13:17 -04:00
Ivan Mironov 431fefbdea prometheus-node-exporter-lua: add basic hwmon exporter
This collector supports following metrics:

 * node_hwmon_temp_celsius
 * node_hwmon_pwm

and following auxiliary mappings:

 * node_hwmon_chip_names
 * node_hwmon_sensor_label

Tested on:

 * Banana Pi BPI-r3 / OpenWrt 23.05.0-rc2
 * TP-Link Archer C7 v5 / OpenWrt 22.03.5

Signed-off-by: Ivan Mironov <mironov.ivan@gmail.com>
2023-10-15 11:13:17 -04:00
Etienne Champetier b499ed05ff
Merge pull request #21005 from joelpet/prometheus-node-exporter-thermal
prometheus-node-exporter-lua: Add thermal collector
2023-10-14 15:22:37 -04:00
Josef Schlehofer 9c2bf85900 prometheus-node-exporter-lua: drop bmx6 package
In the OpenWrt routing feed, package bmx6 and luci-app-bmx6 were removed because the LuCI app was vulnerable to several CVEs, as found by dependabot. It has been reporting it for a few months and has even created an issue. These two packages are not maintained in OpenWrt as well in upstream.

Users should switch to the bmx7 package.

Fixes: 9fb9d9343ea27d6dbb5008ece10c0c843dd2c781 ("bmx6: drop package") in the routing feed

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
2023-10-03 11:58:03 +02:00
Joel Pettersson 1eeb1dc2de prometheus-node-exporter-lua: Add thermal collector
Signed-off-by: Joel Pettersson <me@joelpet.se>
2023-06-13 22:19:16 +02:00
Andre Heider 6f3b345499 prometheus-node-exporter-lua: adapt dependencies for the dsl collector
All lantiq/intel/maxlinear compatible dsl daemons now provide a common
package name, switch over.

Signed-off-by: Andre Heider <a.heider@gmail.com>
2022-09-14 09:09:05 +02:00
Gregor Michels 201457c17a prometheus-node-exporter-lua: add realtek-poe exporter
exposes PoE metrics obtained from realtek-poe

 # HELP realtek_poe_switch_info information about the poe controller
 # TYPE realtek_poe_switch_info gauge
 realtek_poe_switch_info{mcu="ST Micro ST32F100 Microcontroller",firmware="v22.4"} 1

 # HELP realtek_poe_switch_budget_watts overall power budget
 # TYPE realtek_poe_switch_budget_watts gauge
 realtek_poe_switch_budget_watts 77

 # HELP realtek_poe_switch_consumption_watts overall power consumption
 # TYPE realtek_poe_switch_consumption_watts gauge
 realtek_poe_switch_consumption_watts 5

 # HELP realtek_poe_port_priority poe priority of port
 # TYPE realtek_poe_port_priority gauge
 realtek_poe_port_priority{device="lan1"} 1
 realtek_poe_port_priority{device="lan2"} 1
 [...]

 # HELP realtek_poe_port_consumption_watts per port power consumption
 # TYPE realtek_poe_port_consumption_watts gauge
 realtek_poe_port_consumption_watts{device="lan1"} 0
 realtek_poe_port_consumption_watts{device="lan2"} 0
 [...]

 # HELP realtek_poe_port_state per port poe state
 # TYPE realtek_poe_port_state gauge
 realtek_poe_port_state{device="lan1",state="Disabled"} 0
 realtek_poe_port_state{device="lan1",state="Searching"} 1
 [...]
 (states: Disabled, Searching, Delivering power, Fault, Other fault, Requesting power)

 # HELP realtek_poe_port_mode per port poe mode
 # TYPE realtek_poe_port_mode gauge
 realtek_poe_port_mode{device="lan1",mode="PoE"} 0
 realtek_poe_port_mode{device="lan1",mode="PoE+"} 1
 [...]
 (modes: PoE, Legacy, pre-PoE+, PoE+)

Signed-off-by: Gregor Michels <hirnpfirsich@brainpeach.de>
2022-08-08 14:55:44 +02:00
Nick Hainke 245d63426b prometheus-node-exporter-lua: fix hostapd stations
We can only utilize statistics from interfaces having ubus interface.

Signed-off-by: Nick Hainke <vincent@systemli.org>
2022-08-07 12:22:34 -04:00
Jonathan Davies 9eeb9b3894 prometheus-node-exporter-lua: Added selinux.lua.
Signed-off-by: Jonathan Davies <jpds@protonmail.com>
2022-07-13 17:15:22 +01:00
Etienne Champetier 1dd46bca62 prometheus-node-exporter-lua: fix waiting for interface
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>
2022-06-12 23:07:00 -04:00
Nick Hainke 0a07237514 prometheus-node-exporter: fix ubus stations
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>
2022-05-29 23:04:12 -04:00
Etienne Champetier 60460f0046 prometheus-node-exporter-lua: use uhttpd-mod-lua
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>
2022-04-25 12:22:22 -04:00
Etienne Champetier 3afccecdb2 prometheus-node-exporter-lua: fixup openwrt collector
Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
2022-04-25 12:22:22 -04:00
Nick Hainke 9f3064a11c prometheus-node-exporter-lua: improve ubnt-manager
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>
2022-04-21 15:04:15 +02:00
Nick Hainke 42e841039b prometheus-node-exporter-lua: fix ubnt-manager collector
Update the version and add ubnt-manager to the build section.

Fixes: 76f27975a9 (" prometheus-node-exporter-lua: add ubnt-manager collector ")

Signed-off-by: Nick Hainke <vincent@systemli.org>
2022-04-04 10:46:25 -04:00
Nick Hainke 76f27975a9 prometheus-node-exporter-lua: add ubnt-manager collector
Ubnt-manager-collector collects statistics from airos devices configured
in ubnt-manager.

Signed-off-by: Nick Hainke <vincent@systemli.org>
2022-04-04 15:36:02 +02:00
René Treffer a315c40b72 prometheus-node-exporter-lua: add netclass.lua collector
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>
2022-03-28 16:08:55 -04:00
Jonathan Davies 80fe862fc3 prometheus-node-exporter-lua: Added entropy.lua.
Signed-off-by: Jonathan Davies <jpds@protonmail.com>
2021-12-25 00:20:50 +01:00
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