X-Git-Url: https://arthur.barton.de/gitweb/?a=blobdiff_plain;f=charts.d%2Fap.chart.sh;h=0e85c486dc95daedb9404d680ac37f42f5a70dfc;hb=a29af3d0cde1eb8aa1667816bcd0a8d467afa82a;hp=10a65688c23c0fed9d5eee0aab1bde4613ca8336;hpb=37cb08efe88d63174877ebaa1868298e862caafd;p=netdata.git diff --git a/charts.d/ap.chart.sh b/charts.d/ap.chart.sh old mode 100755 new mode 100644 index 10a65688..0e85c486 --- a/charts.d/ap.chart.sh +++ b/charts.d/ap.chart.sh @@ -1,4 +1,10 @@ -#!/bin/bash +# no need for shebang - this file is loaded from charts.d.plugin + +# netdata +# real-time performance and health monitoring, done right! +# (C) 2016 Costa Tsaousis +# GPL v3+ +# # _update_every is a special variable - it holds the number of seconds # between the calls of the _update() function @@ -7,11 +13,11 @@ ap_priority=6900 declare -A ap_devs=() -export PATH="${PATH}:/sbin:/usr/sbin:/usr/local/sbin" - # _check is called once, to find out if this chart should be enabled or not ap_check() { - local ev=$(iw dev | awk ' + require_cmd iw || return 1 + + local ev=$(run iw dev | awk ' BEGIN { i = ""; ssid = ""; @@ -41,6 +47,7 @@ ap_check() { # - 1 to disable the chart [ ${#ap_devs[@]} -gt 0 ] && return 0 + error "no devices found in AP mode, with 'iw dev'" return 1 } @@ -54,25 +61,25 @@ ap_create() { # create the chart with 3 dimensions cat <