File tree Expand file tree Collapse file tree 2 files changed +19
-4
lines changed
Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Original file line number Diff line number Diff 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
1213include ../../profile.mk
Original file line number Diff line number Diff line change @@ -6,11 +6,26 @@ pushgateway_password=$(uci get lime-autogen.pushgateway.password)
66metrics_file=/tmp/prometheus-metrics
77domain=$( uci get lime-autogen.system.domain)
88lan_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' )
109host=$( uci get system.@system[0].hostname)
1110token=" $( 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+
1429wget -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
2539rm " $metrics_file "
You can’t perform that action at this time.
0 commit comments