Skip to content

Commit 68e68e8

Browse files
committed
antennine.org: an-metrics: add wifi-stations-extra + minors
- push a subset of metrics ~30KB -> ~16KB - remove conditional label
1 parent 78713cc commit 68e68e8

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

antennine.org/an-metrics/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ PROFILE_DEPENDS:=\
77
+prometheus-node-exporter-lua-openwrt \
88
+prometheus-node-exporter-lua-wifi \
99
+prometheus-node-exporter-lua-wifi_stations \
10+
+prometheus-node-exporter-lua-wifi-stations-extra \
1011
+prometheus-node-exporter-lua-location-latlon
1112

1213
include ../../profile.mk

antennine.org/an-metrics/root/usr/bin/prometheus-push

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,26 @@ pushgateway_password=$(uci get lime-autogen.pushgateway.password)
66
metrics_file=/tmp/prometheus-metrics
77
domain=$(uci get lime-autogen.system.domain)
88
lan_ipv4=$(uci get network.lan.ipaddr)
9-
wan_ipv4=$(ip -o route get to 4.2.2.2 | sed -n 's|.*src \([0-9.]\+\).*|\1|p')
109
host=$(uci get system.@system[0].hostname)
1110
token="$(echo -n "$pushgateway_user:$pushgateway_password" | base64)"
1211

13-
prometheus-node-exporter-lua > "$metrics_file"
12+
# push a subset of metrics
13+
prometheus-node-exporter-lua | grep \
14+
-e scrape \
15+
-e time \
16+
\
17+
-e wifi \
18+
-e bytes \
19+
\
20+
-e cpu \
21+
-e load \
22+
\
23+
-e openwrt \
24+
-e uname \
25+
\
26+
-e location \
27+
> "$metrics_file"
28+
1429
wget -qO /dev/null \
1530
--post-file "$metrics_file" \
1631
--header="Authorization: Basic $token" \
@@ -19,7 +34,6 @@ https://${pushgateway_host}/metrics\
1934
/domain/${domain}\
2035
/instance/${lan_ipv4}\
2136
/port/9090\
22-
/host/${host}\
23-
$( [ $wan_ipv4 != $lan_ipv4 ] && echo "/wan/$wan_ipv4" )
37+
/host/${host}
2438

2539
rm "$metrics_file"

0 commit comments

Comments
 (0)