以前から、実現しよう、したいと思っていたことがあって、諸事情でやることになった。
そこでいろいろと調べていたのだが、若干微妙な問題にぶち当たった。
何がやりたかったかというと、「SSID毎に、何端末接続されているか。」という簡単なこと。
それをグラフ化したかったのだが、どうもそのままでは出来ないらしい。
たとえば、11a/11g毎にAssociation数は簡単に取得することができるが、それ以上はどうやら出来ないらしい。
802.11a / Dot11Radio1 OID: .1.3.6.1.4.1.9.9.273.1.1.2.1.1.1 802.11b/g / Dot11Radio0 OID: .1.3.6.1.4.1.9.9.273.1.1.2.1.1.2
じゃあ、どうやってSSID毎にクライアント数を取得するのか、調べてみたところ、Vlan毎にMacAddressとクライアント情報を取得することが出来るので、 その情報を取得して集計すれば、可能であることがわかった。
すべては、EnterpriseMIBを参照してくれと言いたいが、ヒントはここ。
OID: .1.3.6.1.4.1.9.9.273.1.2.1 ----- This table contains configuration information of client devices. Entries on this table are created by the device radio driver when clients establish association with the device. Entries are removed when clients disassociate with the device. These clients include:wireless clients, repeaters, and bridges. On Infrastructure clients like repeaters, non-root bridges and workgroup bridges, this table also has an entry for the parent device they are associated to. -----
その中のサブツリーにある値を取得すれば解決出来る。
OID: .1.3.6.1.4.1.9.9.273.1.2.1.1.17 ----- This is the VLAN which this wireless client is assigned to when it is successfully associated to the wireless station. The value is 0 if this wireless client is not assigned to any VLAN or this wireless station is not configured with any VLAN.
取得すると次のような値を得れる。
$ snmpwalk -c public -v2c 10.11.22.33 .1.3.6.1.4.1.9.9.273.1.2.1.1.17 SNMPv2-SMI::enterprises.9.9.273.1.2.1.1.17.1.7.116.111.109.111.99.104.97.64.48.4.85.251.201 = Gauge32: 20 SNMPv2-SMI::enterprises.9.9.273.1.2.1.1.17.2.7.116.111.109.111.99.104.97.0.19.206.103.93.62 = Gauge32: 20 SNMPv2-SMI::enterprises.9.9.273.1.2.1.1.17.2.7.116.111.109.111.99.104.97.0.29.224.24.229.137 = Gauge32: 20
ただし、注意しないといけないのは、Dot11Radio0 及び Dot11Radio1 の合計数となることだ。
そのため、11a/g別にSSID単位で取得することが出来ない。
上記の値を適当に、CactiやMRTG等に喰わせれば、Vlan=SSID毎にユーザ数の取得が出来るだろう。
あとは苦肉の策として、802.11a と g ではVLAN番号を変えてしまうというのも一つの手だ。。。orz
ということで、snmpwalk, grep, wc あたりを使って適当につっこんじゃいますか...
もっときれいな方法はないかなぁ...