forked from freifunk-franken/firmware
fff-nodewatcher: Add detailed clients data
This adds data about the clients per interface Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> Tested-by: Christian Dresel <fff@chrisi01.de> Reviewed-by: Christian Dresel <fff@chrisi01.de>
This commit is contained in:
parent
748c8aec2a
commit
145e057a77
|
@ -1,7 +1,7 @@
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=fff-nodewatcher
|
PKG_NAME:=fff-nodewatcher
|
||||||
PKG_VERSION:=45
|
PKG_VERSION:=46
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
|
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# Netmon Nodewatcher (C) 2010-2012 Freifunk Oldenburg
|
# Netmon Nodewatcher (C) 2010-2012 Freifunk Oldenburg
|
||||||
# License; GPL v3
|
# License; GPL v3
|
||||||
|
|
||||||
SCRIPT_VERSION="45"
|
SCRIPT_VERSION="46"
|
||||||
|
|
||||||
test -f /tmp/started || exit
|
test -f /tmp/started || exit
|
||||||
|
|
||||||
|
@ -259,10 +259,12 @@ crawl() {
|
||||||
err "$(date): Collecting information about conected clients"
|
err "$(date): Collecting information about conected clients"
|
||||||
#CLIENTS
|
#CLIENTS
|
||||||
client_count=0
|
client_count=0
|
||||||
|
dataclient=""
|
||||||
CLIENT_INTERFACES=$(bridge link | awk '$2 !~/^bat/{ printf $2" " }')
|
CLIENT_INTERFACES=$(bridge link | awk '$2 !~/^bat/{ printf $2" " }')
|
||||||
for clientif in ${CLIENT_INTERFACES}; do
|
for clientif in ${CLIENT_INTERFACES}; do
|
||||||
local cc=$(bridge fdb show br "$MESH_INTERFACE" brport "$clientif" | grep -v self | grep -v permanent -c)
|
local cc=$(bridge fdb show br "$MESH_INTERFACE" brport "$clientif" | grep -v self | grep -v permanent -c)
|
||||||
client_count=$((client_count + cc))
|
client_count=$((client_count + cc))
|
||||||
|
dataclient="$dataclient<$clientif>$cc</$clientif>"
|
||||||
done
|
done
|
||||||
|
|
||||||
err "$(date): Putting all information into a XML-File and save it at $SCRIPT_DATA_FILE"
|
err "$(date): Putting all information into a XML-File and save it at $SCRIPT_DATA_FILE"
|
||||||
|
@ -275,6 +277,7 @@ crawl() {
|
||||||
DATA=$DATA"<batman_adv_gateway_mode>$batman_adv_gateway_mode</batman_adv_gateway_mode>"
|
DATA=$DATA"<batman_adv_gateway_mode>$batman_adv_gateway_mode</batman_adv_gateway_mode>"
|
||||||
DATA=$DATA"<batman_adv_gateway_list>$batman_adv_gateway_list</batman_adv_gateway_list>"
|
DATA=$DATA"<batman_adv_gateway_list>$batman_adv_gateway_list</batman_adv_gateway_list>"
|
||||||
DATA=$DATA"<client_count>$client_count</client_count>"
|
DATA=$DATA"<client_count>$client_count</client_count>"
|
||||||
|
DATA=$DATA"<clients>$dataclient</clients>"
|
||||||
DATA=$DATA"</data>"
|
DATA=$DATA"</data>"
|
||||||
|
|
||||||
#write data to xml file that provides the data on httpd
|
#write data to xml file that provides the data on httpd
|
||||||
|
|
Loading…
Reference in New Issue
Block a user