[PATCH v2] nodewatcher: Provide data to calculate airtime

Christian Dresel fff at chrisi01.de
So Jan 21 20:49:28 CET 2018


hi

danke für die Arbeit

Tested-by: Christian Dresel <fff at chrisi01.de>
Reviewed-by: Christian Dresel <fff at chrisi01.de>

wenn jemand ne Möglichkeit findet das nicht von dem Interface (wXap)
sondern direkt vom phy zu lesen, sollten wir das mal ändern ich hab aber
nix gefunden.

mfg

Christian

On 21.01.2018 20:47, Adrian Schmutzler wrote:
> 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</batman_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
> 

-------------- nächster Teil --------------
Ein Dateianhang mit Binärdaten wurde abgetrennt...
Dateiname   : signature.asc
Dateityp    : application/pgp-signature
Dateigröße  : 833 bytes
Beschreibung: OpenPGP digital signature
URL         : <http://lists.freifunk.net/pipermail/franken-dev-freifunk.net/attachments/20180121/9762557b/attachment.sig>


Mehr Informationen über die Mailingliste franken-dev