From e962f47130f0ed3cc27fd3756758022c81501a1c Mon Sep 17 00:00:00 2001 From: Someone Date: Sat, 29 Dec 2012 15:25:37 +0100 Subject: [PATCH] hostapd stats script --- hostap | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100755 hostap diff --git a/hostap b/hostap new file mode 100755 index 0000000..c504770 --- /dev/null +++ b/hostap @@ -0,0 +1,40 @@ +#!/bin/sh + +if [ "$1" = "autoconf" ]; then + echo "yes" + exit 0 +fi + +if [ "$1" = "config" ]; then + echo "graph_title Hostapd status" + echo "graph_info This graph shows the status of stations connected to the wlan." + echo "graph_category hostapd" + echo "graph_order numsta numstanonerp numstanoshortslottime numstanoshortpreamble cauth cassoc cauthorized" + echo "graph_printf %.0lf" + echo "graph_scale no" + echo "graph_args -l 0" + echo "numsta.label Number of all stations" + echo "numsta.draw LINE2" + echo "numstanonerp.label Non-erp stations" + echo "numstanonerp.draw LINE2" + echo "numstanoshortslottime.label Non-short-slot-time stations" + echo "numstanoshortslottime.draw LINE2" + echo "numstanoshortpreamble.label Non-short-preamble stations" + echo "numstanoshortpreamble.draw LINE2" + echo "cauth.label Clients auth" + echo "cauth.draw LINE2" + echo "cassoc.label Clients assoc" + echo "cassoc.draw LINE2" + echo "cauthorized.label Clients authorized" + echo "cauthorized.draw LINE2" + exit 0 +fi + +killall -SIGUSR1 hostapd &> /dev/null + +head -n3 /tmp/hostapd.dump | tail -n2 | sed -e 's/ /\n/g' -e 's/_//g' -e 's/=/.value /g' +echo "cauth.value $(grep '\[AUTH\]' /tmp/hostapd.dump | wc -l)" +echo "cassoc.value $(grep '\[ASSOC\]' /tmp/hostapd.dump | wc -l)" +echo "cauthorized.value $(grep '\[AUTHORIZED\]' /tmp/hostapd.dump | wc -l)" + +exit 0 -- 2.43.0