From 2e85f9325a797977eea9dfea0a925775ddd211d9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Feb 2021 12:49:00 +0100 Subject: Merging upstream version 1.29.0. Signed-off-by: Daniel Baumann --- collectors/charts.d.plugin/ap/README.md | 19 ++++++++-- collectors/charts.d.plugin/ap/ap.chart.sh | 60 +++++++++++++++---------------- 2 files changed, 46 insertions(+), 33 deletions(-) (limited to 'collectors/charts.d.plugin/ap') diff --git a/collectors/charts.d.plugin/ap/README.md b/collectors/charts.d.plugin/ap/README.md index befe21eec..35a00d65d 100644 --- a/collectors/charts.d.plugin/ap/README.md +++ b/collectors/charts.d.plugin/ap/README.md @@ -1,4 +1,10 @@ -# Access Point Plugin (ap) + + +# Access point monitoring with Netdata The `ap` collector visualizes data related to access points. @@ -76,8 +82,15 @@ Station 40:b8:37:5a:ed:5e (on wlan0) ## Configuration -You can only set `ap_update_every=NUMBER` to `/etc/netdata/charts.d/ap.conf`, to give the data collection frequency. -To edit this file on your system run `/etc/netdata/edit-config charts.d/ap.conf`. +Edit the `charts.d/ap.conf` configuration file using `edit-config` from the Netdata [config +directory](/docs/configure/nodes.md), which is typically at `/etc/netdata`. + +```bash +cd /etc/netdata # Replace this path with your Netdata config directory, if different +sudo ./edit-config charts.d/ap.conf +``` + +You can only set `ap_update_every=NUMBER` to change the data collection frequency. ## Auto-detection diff --git a/collectors/charts.d.plugin/ap/ap.chart.sh b/collectors/charts.d.plugin/ap/ap.chart.sh index a2d04c0a7..5dd787835 100644 --- a/collectors/charts.d.plugin/ap/ap.chart.sh +++ b/collectors/charts.d.plugin/ap/ap.chart.sh @@ -16,9 +16,9 @@ declare -A ap_devs=() # _check is called once, to find out if this chart should be enabled or not ap_check() { - require_cmd iw || return 1 - local ev - ev=$(run iw dev | awk ' + require_cmd iw || return 1 + local ev + ev=$(run iw dev | awk ' BEGIN { i = ""; ssid = ""; @@ -41,26 +41,26 @@ ap_check() { } } ') - eval "${ev}" + eval "${ev}" - # this should return: - # - 0 to enable the chart - # - 1 to disable the chart + # this should return: + # - 0 to enable the chart + # - 1 to disable the chart - [ ${#ap_devs[@]} -gt 0 ] && return 0 - error "no devices found in AP mode, with 'iw dev'" - return 1 + [ ${#ap_devs[@]} -gt 0 ] && return 0 + error "no devices found in AP mode, with 'iw dev'" + return 1 } # _create is called once, to create the charts ap_create() { - local ssid dev + local ssid dev - for dev in "${!ap_devs[@]}"; do - ssid="${ap_devs[${dev}]}" + for dev in "${!ap_devs[@]}"; do + ssid="${ap_devs[${dev}]}" - # create the chart with 3 dimensions - cat <