]> git.somenet.org - somenet/munin.git/blob - hostap
more munin fields
[somenet/munin.git] / hostap
1 #!/bin/sh
2
3 if [ "$1" = "autoconf" ]; then
4         echo "yes"
5         exit 0
6 fi
7
8 if [ "$1" = "config" ]; then
9     echo "graph_title Hostapd status"
10     echo "graph_info This graph shows the status of stations connected to the wlan."
11     echo "graph_category hostapd"
12 #    echo "graph_order numsta numstanonerp numstanoshortslottime numstanoshortpreamble cauth cassoc cauthorized cshopre cwmm"
13     echo "graph_printf %.0lf"
14     echo "graph_scale no"
15     echo "graph_args -l 0"
16     echo "numsta.label Number of all stations"
17     echo "numsta.draw LINE2"
18     echo "numstanonerp.label Non-erp stations"
19     echo "numstanonerp.draw LINE2"
20     echo "numstanoshortslottime.label Non-short-slot-time stations"
21     echo "numstanoshortslottime.draw LINE2"
22     echo "numstanoshortpreamble.label Non-short-preamble stations"
23     echo "numstanoshortpreamble.draw LINE2"
24     echo "cauth.label Clients AUTH"
25     echo "cauth.draw LINE2"
26     echo "cassoc.label Clients ASSOC"
27     echo "cassoc.draw LINE2"
28     echo "cauthorized.label Clients AUTHORIZED"
29     echo "cauthorized.draw LINE2"
30     echo "cshopre.label Clients SHORT_PREAMBLE"
31     echo "cshopre.draw LINE2"
32     echo "cwmm.label Clients WMM"
33     echo "cwmm.draw LINE2"
34     echo "cps.label Clients PS"
35     echo "cps.draw LINE2"
36     echo "ctim.label Clients TIM"
37     echo "ctim.draw LINE2"
38     echo "cperm.label Clients PERM"
39     echo "cperm.draw LINE2"
40     echo "cwds.label Clients WDS"
41     echo "cwds.draw LINE2"
42     echo "cwps.label Clients WPS"
43     echo "cwps.draw LINE2"
44     echo "cwps2.label Clients WPS2"
45     echo "cwps2.draw LINE2"
46     echo "cpp.label Clients PENDING_POLL"
47     echo "cpp.draw LINE2"
48     echo "cmfp.label Clients MFP"
49     echo "cmfp.draw LINE2"
50     echo "cmwps.label Clients MAYBE_WPS"
51     echo "cmwps.draw LINE2"
52     echo "cpreauth.label Clients PREAUTH"
53     echo "cpreauth.draw LINE2"
54     echo "cnonerp.label Clients NonERP"
55     echo "cnonero.draw LINE2"
56     exit 0
57 fi
58
59 killall -SIGUSR1 hostapd &> /dev/null
60
61 head -n3 /tmp/hostapd.dump | tail -n2 | sed -e 's/ /\n/g' -e 's/_//g' -e 's/=/.value /g'
62 echo "cauth.value $(grep '\[AUTH\]' /tmp/hostapd.dump | wc -l)"
63 echo "cassoc.value $(grep '\[ASSOC\]' /tmp/hostapd.dump | wc -l)"
64 echo "cauthorized.value $(grep '\[AUTHORIZED\]' /tmp/hostapd.dump | wc -l)"
65 echo "cshopre.value $(grep '\[SHORT_PREAMBLE\]' /tmp/hostapd.dump | wc -l)"
66 echo "cwmm.value $(grep '\[WMM\]' /tmp/hostapd.dump | wc -l)"
67 echo "cps.value $(grep '\[PS\]' /tmp/hostapd.dump | wc -l)"
68 echo "ctim.value $(grep '\[TIM\]' /tmp/hostapd.dump | wc -l)"
69 echo "cperm.value $(grep '\[PERM\]' /tmp/hostapd.dump | wc -l)"
70 echo "cwps.value $(grep '\[WPS\]' /tmp/hostapd.dump | wc -l)"
71 echo "cwps2.value $(grep '\[WPS2\]' /tmp/hostapd.dump | wc -l)"
72 echo "cwds.value $(grep '\[WDS\]' /tmp/hostapd.dump | wc -l)"
73 echo "cpp.value $(grep '\[PENDING_POLL\]' /tmp/hostapd.dump | wc -l)"
74 echo "cmfp.value $(grep '\[MFP\]' /tmp/hostapd.dump | wc -l)"
75 echo "cmwps.value $(grep '\[MAYBE_WPS\]' /tmp/hostapd.dump | wc -l)"
76 echo "cpreauth.value $(grep '\[PREAUTH\]' /tmp/hostapd.dump | wc -l)"
77 echo "cnonerp.value $(grep '\[NonERP\]' /tmp/hostapd.dump | wc -l)"
78
79 exit 0
80