Commit Graph

30 Commits

Author SHA1 Message Date
Etienne Champetier 80742d0da2 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>
(cherry picked from commit a14bed1bc9)
2019-08-15 23:12:17 -07:00
Kirill Lukonin 06e513ba3e 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>
(cherry picked from commit 5eb8e47df2)
2019-08-15 23:12:10 -07:00
Alex Tomlins 60002eb621 prometheus-node-exporter-lua: Bump PKG_RELEASE
Signed-off-by: Alex Tomlins <alex@tomlins.org.uk>
(cherry picked from commit 4b6f76bfac)
2019-08-15 23:11:55 -07:00
Alex Tomlins 1014b09871 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>
(cherry picked from commit 1237e196b4)
2019-08-15 23:11:48 -07:00
Alex Tomlins 0d224bdfa1 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>
(cherry picked from commit a45c702baa)
2019-08-15 23:11:41 -07:00
Alex Tomlins a08f5e17f6 prometheus-node-exporter-lua: Bump PKG_RELEASE
Signed-off-by: Alex Tomlins <alex@tomlins.org.uk>
(cherry picked from commit deab22044b)
2019-08-15 23:11:31 -07:00
Alex Tomlins b03545e0bc 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>
(cherry picked from commit 0100a2cb26)
2019-08-15 23:11:23 -07:00
Piotr Machała 70bd5a36cd prometheus-node-exporter-lua: change network metric type to counter
Signed-off-by: Piotr Machała <pm7gt@933x.net>
(cherry picked from commit 626b197cc1)
2019-08-15 23:08:19 -07:00
Rene Treffer ad34675dfb 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>
(cherry picked from commit c751af8616)
2019-08-15 23:08:09 -07:00
Leonid Evdokimov 8ccfae065f prometheus-node-exporter-lua: close io.popen files to reap zombies
Signed-off-by: Leonid Evdokimov <leon@darkk.net.ru>
2018-11-25 16:56:38 -05:00
Etienne Champetier 98822cd11d 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:27:39 +02:00
Etienne Champetier 605acbbebe 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:27:34 +02:00
Paul Spooren fcaf255d0f 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-29 18:21:03 +09:00
Paul Spooren 9e1fcd153b 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-21 20:34:24 +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
Etienne Champetier 84023027a2 prometheus-node-exporter-lua: split out nat_traffic and netstat
nat_traffic is too verbose to be really useful by default
netstat is broken by default on OpenWrt/LEDE

Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
2017-12-08 21:22:16 -08:00
Etienne Champetier fba739d32d prometheus-node-exporter-lua: put wifi collector in 2 separate packages
this allow to remove libubus-lua/libiwinfo-lua dependency from main package
this also allow to have different scrape_interval

Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>

split stations

Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
2017-12-08 21:22:16 -08:00
Etienne Champetier 32e1baeddd prometheus-node-exporter-lua: make it modular
As prometheus-node-exporter-lua is a reimplementation of node_exporter,
I'm using "collector" instead of "scraper" and renaming some collectors

put each collector in a separate file

report collector success/failure and duration per scrape
(follow https://github.com/prometheus/node_exporter/pull/516)

allow to filter collectors using "collect[]" params
(see https://github.com/prometheus/node_exporter#filtering-enabled-collectors)

Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
2017-12-08 21:22:16 -08:00
Etienne Champetier 7b1b69ca6c prometheus-node-exporter-lua: rewrite wifi scraper
On my bullet m2, scrape duration goes from between 0.2 and 0.5 to a stable 0.025
We also don't depend on luci anymore

This remove wifi_network_up metric, but this metric was buggy
wifi_network_up{ifname="wlan0-1",ssid="test1",channel="11",mode="Master",bssid="12:34:56:78:9A:BC",country="FR",frequency="2.462"} 1
wifi_network_up{ifname="radio0.network2",ssid="test1",channel="11",mode="Master",country="US",frequency="2.462"} 0

Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
2017-12-08 21:22:16 -08:00
Etienne Champetier 747f4ce7af prometheus-node-exporter-lua: fix nat scraper
Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
2017-12-08 21:22:16 -08:00
Etienne Champetier 58c136a521 prometheus-node-exporter-lua: improve node_uname_info
Testing on a bullet m2, uname collector was taking on average 0.12
it now takes 0.0007

Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
2017-12-08 21:22:16 -08:00
Etienne Champetier c79e75d0c1 prometheus-node-exporter-lua: respond with HTTP/1.0
also reduce calls to output()

Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
2017-12-08 21:22:16 -08:00
Etienne Champetier 4e94edce51 prometheus-node-exporter-lua: send stdout/stderr to logread
Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
2017-12-08 21:22:16 -08:00
Christian Simon d27d9e566a prometheus-node-exporter-lua: adds node metrics exporter
Signed-off-by: Christian Simon <simon@swine.de>
2017-05-08 14:27:43 +01:00