[PATCH v2] nodewatcher: Provide data to calculate airtime

Tim Niemeyer tim at tn-x.org
So Jan 28 12:36:40 CET 2018


Hi

Und applied.

Tim

Am Sonntag, den 21.01.2018, 20:47 +0100 schrieb Adrian Schmutzler:
> The actual calculation is done in the Monitoring.
> 
> Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
> 
> Tested-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
> 
> ---
> 
> Changes in v2:
> - Use wXap instead of wXmesh
> ---
>  src/packages/fff/fff-nodewatcher/Makefile               |  2 +-
>  .../fff/fff-nodewatcher/files/usr/sbin/nodewatcher      | 17
> ++++++++++++++++-
>  2 files changed, 17 insertions(+), 2 deletions(-)
> 
> diff --git a/src/packages/fff/fff-nodewatcher/Makefile
> b/src/packages/fff/fff-nodewatcher/Makefile
> index 273916b..633ec71 100644
> --- a/src/packages/fff/fff-nodewatcher/Makefile
> +++ b/src/packages/fff/fff-nodewatcher/Makefile
> @@ -1,7 +1,7 @@
>  include $(TOPDIR)/rules.mk
>  
>  PKG_NAME:=fff-nodewatcher
> -PKG_VERSION:=46
> +PKG_VERSION:=47
>  PKG_RELEASE:=1
>  
>  PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
> diff --git a/src/packages/fff/fff-
> nodewatcher/files/usr/sbin/nodewatcher b/src/packages/fff/fff-
> nodewatcher/files/usr/sbin/nodewatcher
> index 195aea5..3b60500 100755
> --- a/src/packages/fff/fff-nodewatcher/files/usr/sbin/nodewatcher
> +++ b/src/packages/fff/fff-nodewatcher/files/usr/sbin/nodewatcher
> @@ -2,7 +2,7 @@
>  # Netmon Nodewatcher (C) 2010-2012 Freifunk Oldenburg
>  # License; GPL v3
>  
> -SCRIPT_VERSION="46"
> +SCRIPT_VERSION="47"
>  
>  test -f /tmp/started || exit
>  
> @@ -267,6 +267,20 @@ crawl() {
>          dataclient="$dataclient<$clientif>$cc</$clientif>"
>      done
>  
> +    dataair=""
> +    w2dump="$(iw dev w2ap survey dump 2> /dev/null | sed
> '/Survey/,/\[in use\]/d')"
> +    if [ -n "$w2dump" ] ; then
> +        w2_ACT="$(ACTIVE=$(echo "$w2dump" | grep "active time:");
> set ${ACTIVE:-0 0 0 0 0}; echo -e "${4}")"
> +        w2_BUS="$(BUSY=$(echo "$w2dump" | grep "busy time:"); set
> ${BUSY:-0 0 0 0 0}; echo -e "${4}")"
> +        dataair="$dataair<airtime2><active>$w2_ACT</active><busy>$w2
> _BUS</busy></airtime2>"
> +    fi
> +    w5dump="$(iw dev w5ap survey dump 2> /dev/null | sed
> '/Survey/,/\[in use\]/d')"
> +    if [ -n "$w5dump" ] ; then
> +        w5_ACT="$(ACTIVE=$(echo "$w5dump" | grep "active time:");
> set ${ACTIVE:-0 0 0 0 0}; echo -e "${4}")"
> +        w5_BUS="$(BUSY=$(echo "$w5dump" | grep "busy time:"); set
> ${BUSY:-0 0 0 0 0}; echo -e "${4}")"
> +        dataair="$dataair<airtime5><active>$w5_ACT</active><busy>$w5
> _BUS</busy></airtime5>"
> +    fi
> +
>      err "$(date): Putting all information into a XML-File and save
> it at $SCRIPT_DATA_FILE"
>  
>      DATA="<?xml version='1.0' standalone='yes'?><data>"
> @@ -278,6 +292,7 @@ crawl() {
>      DATA=$DATA"<batman_adv_gateway_list>$batman_adv_gateway_list</ba
> tman_adv_gateway_list>"
>      DATA=$DATA"<client_count>$client_count</client_count>"
>      DATA=$DATA"<clients>$dataclient</clients>"
> +    DATA=$DATA"$dataair"
>      DATA=$DATA"</data>"
>  
>      #write data to xml file that provides the data on httpd
> -- 
> 2.7.4
> 
-------------- nächster Teil --------------
Ein Dateianhang mit Binärdaten wurde abgetrennt...
Dateiname   : signature.asc
Dateityp    : application/pgp-signature
Dateigröße  : 488 bytes
Beschreibung: This is a digitally signed message part
URL         : <http://lists.freifunk.net/pipermail/franken-dev-freifunk.net/attachments/20180128/fabaa178/attachment.sig>


Mehr Informationen über die Mailingliste franken-dev