#!/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