It would be useful if CCQ, working frequency and noise floor data from Wireless interfaces were available via SNMP.
Currently we push this information to a remote syslog_ng daemon and then feed this into a PostgreSQL database from where the information is retrieved by Cricket, but it would simplify matters considerably if this data were available via SNMP and could be retrieved in the same way as all the other data we record in Cricket.
For stuff not yet in snmp, I’ve been using ssh with keys to get the data. Here is a script I use to keep our inventory database of mikrotiks up to date.
jp@mocha:~> more /usr/local/mis/bin/db.update.mt
#!/bin/bash
MYCMD="mysql -B -N -h 127.0.0.1 -u root -s -pxxxxxxxxxxxx -e "
for IP in `$MYCMD " use mt; select ip from router;"` ; do
VER=`snmpget -r2 -v1 -c public -Ovq $IP .1.3.6.1.4.1.14988.1.1.4.4.0 |cut -d" " -f1|sed -e "s/\"//g"`
NAME=`snmpget -r2 -v1 -c public -Ovq $IP SNMPv2-MIB::sysName.0 |cut -d: -f4`
RADIOS=`snmpwalk -v1 -c public -Ovq $IP .1.3.6.1.2.1.2.2.1.3 |grep ieee80211 |wc -l`
ETHERS=`snmpwalk -v1 -c public -Ovq $IP .1.3.6.1.2.1.2.2.1.3 |grep ethernetCsmacd |wc -l`
VLANS=`snmpwalk -v1 -c public -Ovq $IP .1.3.6.1.2.1.2.2.1.3 |grep l2vlan |wc -l`
LICENSE=`snmpwalk -v1 -c public -Ovq $IP .1.3.6.1.4.1.14988.1.1.4.3.0`
SSHACCESS=`$MYCMD "use mt; select sshaccess from router where ip='$IP';"`
SYSTEM=
if [ 1 == $SSHACCESS ]
then
V=`echo $VER |cut -b1`
if [ $V -ge 3 ]
then
SYSTEM=`ssh jp@10.0.0.7 "ssh admin@$IP system resource print" |grep board-name |cut -d: -f2`
fi
# if [ $V -lt 3 ]
# then
# SYSTEM=` ssh jp@10.0.0.7 "ssh admin@$IP system routerboard print; ssh admin@$IP system resource print" |egrep -i
"model|cpu:" |head -n 1 |cut -d: -f2`
# echo $NAME $SYSTEM
# fi
fi
SYSTEM=` ssh jp@10.0.0.7 "ssh admin@$IP system routerboard print; ssh admin@$IP system resource print" |egrep -i
"model|cpu:" |head -n 1 |cut -d: -f2`
$MYCMD "use mt; update router set version='$VER' where IP='$IP'"
$MYCMD "use mt; update router set hostname='$NAME' where ip='$IP'"
$MYCMD "use mt; update router set radios='$RADIOS' where ip='$IP'"
$MYCMD "use mt; update router set ethers='$ETHERS' where ip='$IP'"
$MYCMD "use mt; update router set vlans='$VLANS' where ip='$IP'"
$MYCMD "use mt; update router set license='$LICENSE' where ip='$IP'"
$MYCMD "use mt; update router set system='$SYSTEM' where ip='$IP'"
done
echo updated > /tmp/db.update.IP.done
jp@mocha:~>
The SNMP wireless interface frequency attribute is currently only available for Stations, it cannot currently be retrieved for the master end of Bridges or AP Bridges. In order to be consistent for all nodes we really need this information available via SNMP for all wireless interface modes.