Open caiwang opened 9 years ago
Comment by unissoft-bj
Friday Jan 23, 2015 at 10:03 GMT
echo "DROP TABLE IF EXISTS z_activesta;" | mysql -uroot -p0ffs4t? wlsp echo "Create table z_activesta(select mac, rssi, sender,netid, firstseen,timestampdiff(second,firstseen,lastseen) as dura, optime as timebysec, SUBSTRING(optime,1,16) as timebymin from wlsta where lastseen >= '2015-01-23 17:30:00' and timestampdiff(second,firstseen,lastseen)>0);" | mysql -uroot -p0ffs4t? wlsp
echo "select mac,avg(rssi) as avgrssi,netid,timebymin from z_activesta where netid='ihost-xx' group by mac,netid,timebymin;" | mysql -uroot -p0ffs4t? wlsp > activesta3.txt echo "select mac,avg(rssi) as avgrssi,netid,timebysec from z_activesta where netid='ihost-xx' group by mac,netid,timebysec;" | mysql -uroot -p0ffs4t? wlsp > activesta4.txt
active station in last 900 seconds:
echo "DROP TABLE IF EXISTS z_activesta;" | mysql -uroot -p0ffs4t? wlsp echo "Create table z_activesta(select mac, rssi, sender,netid, firstseen,timestampdiff(second,firstseen,lastseen) as dura, optime as timebysec, SUBSTRING(optime,1,16) as timebymin from wlsta where timestampdiff(second,lastseen,now())<='900' and timestampdiff(second,firstseen,lastseen)>0);" | mysql -uroot -p0ffs4t? wlsp
echo "select mac,avg(rssi) as avgrssi,netid,timebymin from z_activesta where netid='ihost-xx' group by mac,netid,timebymin;" | mysql -uroot -p0ffs4t? wlsp > activesta1.txt
echo "select mac,avg(rssi) as avgrssi,netid,timebysec from z_activesta where netid='ihost-xx' group by mac,netid,timebysec;" | mysql -uroot -p0ffs4t? wlsp > activesta2.txt