diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2019-02-08 07:30:37 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2019-02-08 07:30:37 +0000 |
commit | 8a7b72f7cd1ccd547a03eb4243294e741d661d3f (patch) | |
tree | 7bc7be4a8e9e298daa1349348400aa2a653866f2 /collectors/charts.d.plugin/ap/ap.chart.sh | |
parent | New upstream version 1.11.1+dfsg (diff) | |
download | netdata-8a7b72f7cd1ccd547a03eb4243294e741d661d3f.tar.xz netdata-8a7b72f7cd1ccd547a03eb4243294e741d661d3f.zip |
Adding upstream version 1.12.0.upstream/1.12.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | collectors/charts.d.plugin/ap/ap.chart.sh | 91 |
1 files changed, 44 insertions, 47 deletions
diff --git a/collectors/charts.d.plugin/ap/ap.chart.sh b/collectors/charts.d.plugin/ap/ap.chart.sh index ccc36120c..a2d04c0a7 100644 --- a/collectors/charts.d.plugin/ap/ap.chart.sh +++ b/collectors/charts.d.plugin/ap/ap.chart.sh @@ -56,8 +56,7 @@ ap_check() { ap_create() { local ssid dev - for dev in "${!ap_devs[@]}" - do + for dev in "${!ap_devs[@]}"; do ssid="${ap_devs[${dev}]}" # create the chart with 3 dimensions @@ -99,14 +98,13 @@ ap_update() { # for each dimension # remember: KEEP IT SIMPLE AND SHORT - for dev in "${!ap_devs[@]}" - do - echo - echo "DEVICE ${dev}" + for dev in "${!ap_devs[@]}"; do + echo + echo "DEVICE ${dev}" iw "${dev}" station dump - done | awk " + done | awk ' function zero_data() { - dev = \"\"; + dev = ""; c = 0; rb = 0; tb = 0; @@ -121,32 +119,32 @@ ap_update() { e = 0; } function print_device() { - if(dev != \"\" && length(dev) > 0) { - print \"BEGIN ap_clients.\" dev; - print \"SET clients = \" c; - print \"END\"; - print \"BEGIN ap_bandwidth.\" dev; - print \"SET received = \" rb; - print \"SET sent = \" tb; - print \"END\"; - print \"BEGIN ap_packets.\" dev; - print \"SET received = \" rp; - print \"SET sent = \" tp; - print \"END\"; - print \"BEGIN ap_issues.\" dev; - print \"SET retries = \" tr; - print \"SET failures = \" tf; - print \"END\"; + if(dev != "" && length(dev) > 0) { + print "BEGIN ap_clients." dev; + print "SET clients = " c; + print "END"; + print "BEGIN ap_bandwidth." dev; + print "SET received = " rb; + print "SET sent = " tb; + print "END"; + print "BEGIN ap_packets." dev; + print "SET received = " rp; + print "SET sent = " tp; + print "END"; + print "BEGIN ap_issues." dev; + print "SET retries = " tr; + print "SET failures = " tf; + print "END"; if( c == 0 ) c = 1; - print \"BEGIN ap_signal.\" dev; - print \"SET signal = \" int(s / c); - print \"END\"; - print \"BEGIN ap_bitrate.\" dev; - print \"SET receive = \" int(rt / c); - print \"SET transmit = \" int(tt / c); - print \"SET expected = \" int(e / c); - print \"END\"; + print "BEGIN ap_signal." dev; + print "SET signal = " int(s / c); + print "END"; + print "BEGIN ap_bitrate." dev; + print "SET receive = " int(rt / c); + print "SET transmit = " int(tt / c); + print "SET expected = " int(e / c); + print "END"; } zero_data(); } @@ -155,28 +153,27 @@ ap_update() { } /^DEVICE / { print_device(); - dev = \$2; + dev = $2; } /^Station/ { c++; } - /^[ \\t]+rx bytes:/ { rb += \$3; } - /^[ \\t]+tx bytes:/ { tb += \$3; } - /^[ \\t]+rx packets:/ { rp += \$3; } - /^[ \\t]+tx packets:/ { tp += \$3; } - /^[ \\t]+tx retries:/ { tr += \$3; } - /^[ \\t]+tx failed:/ { tf += \$3; } - /^[ \\t]+signal:/ { x = \$2; s += x * 1000; } - /^[ \\t]+rx bitrate:/ { x = \$3; rt += x * 1000; } - /^[ \\t]+tx bitrate:/ { x = \$3; tt += x * 1000; } - /^[ \\t]+expected throughput:(.*)Mbps/ { - x=\$3; - sub(/Mbps/, \"\", x); + /^[ \t]+rx bytes:/ { rb += $3; } + /^[ \t]+tx bytes:/ { tb += $3; } + /^[ \t]+rx packets:/ { rp += $3; } + /^[ \t]+tx packets:/ { tp += $3; } + /^[ \t]+tx retries:/ { tr += $3; } + /^[ \t]+tx failed:/ { tf += $3; } + /^[ \t]+signal:/ { x = $2; s += x * 1000; } + /^[ \t]+rx bitrate:/ { x = $3; rt += x * 1000; } + /^[ \t]+tx bitrate:/ { x = $3; tt += x * 1000; } + /^[ \t]+expected throughput:(.*)Mbps/ { + x=$3; + sub(/Mbps/, "", x); e += x * 1000; } END { print_device(); } - " + ' return 0 } - |