Aruba WLC から情報を拾ってみる

 

WLCからSNMPで色々拾ってみるテストです。

wlc_snmp_get_test.sh

#!/bin/bash

TIME_A=`date +%s`
TMPFILE=$(mktemp "/tmp/${0##*/}.tmp.XXXXXX")

echo '########' >> $TMPFILE
echo -n 'script start at ' >> $TMPFILE
date >> $TMPFILE
echo '' >> $TMPFILE
echo -n '.'

echo '########' >> $TMPFILE
echo sysDescr >> $TMPFILE
snmpwalk -v 2c -c iba_public 157.80.246.44 system.sysDescr >> $TMPFILE
echo '' >> $TMPFILE
echo -n '.'

echo '########' >> $TMPFILE
echo nUserName >> $TMPFILE
snmpwalk -v 2c -c iba_public 157.80.246.44 .1.3.6.1.4.1.14823.2.2.1.4.1.2.1.3    >> $TMPFILE
echo '' >> $TMPFILE
echo -n '.'

echo '########' >> $TMPFILE
echo nUserApLocation >> $TMPFILE
snmpwalk -v 2c -c iba_public 157.80.246.44 .1.3.6.1.4.1.14823.2.2.1.4.1.2.1.10   >> $TMPFILE
echo '' >> $TMPFILE
echo -n '.'

echo '########' >> $TMPFILE
echo nUserApBSSID >> $TMPFILE
snmpwalk -v 2c -c iba_public 157.80.246.44 .1.3.6.1.4.1.14823.2.2.1.4.1.2.1.11   >> $TMPFILE
echo '' >> $TMPFILE
echo -n '.'

echo '########' >> $TMPFILE
echo nUserCurrentVlan >> $TMPFILE
snmpwalk -v 2c -c iba_public 157.80.246.44 .1.3.6.1.4.1.14823.2.2.1.4.1.2.1.22   >> $TMPFILE
echo '' >> $TMPFILE
echo -n '.'

echo '########' >> $TMPFILE
echo wlanAPName >> $TMPFILE
snmpwalk -v 2c -c iba_public 157.80.246.44 .1.3.6.1.4.1.14823.2.2.1.5.2.1.4.1.3  >> $TMPFILE
echo '' >> $TMPFILE
echo -n '.'

echo '########' >> $TMPFILE
echo wlanAPBssidAPMacAddress >> $TMPFILE
snmpwalk -v 2c -c iba_public 157.80.246.44 .1.3.6.1.4.1.14823.2.2.1.5.2.1.7.1.13 >> $TMPFILE
echo '' >> $TMPFILE
echo -n '.'

echo '########' >> $TMPFILE
echo -n 'script end at ' >> $TMPFILE
date >> $TMPFILE
echo -n 'dulation ' >> $TMPFILE
TIME_B=`date +%s`
PT=`expr ${TIME_B} - ${TIME_A}`
H=`expr ${PT} / 3600`
PT=`expr ${PT} % 3600`
M=`expr ${PT} / 60`
S=`expr ${PT} % 60`
printf "%02d:%02d:%02d\n" $H $M $S >> $TMPFILE
echo 'done.'