2016-05-24 20:42:33 +01:00
|
|
|
<?php
|
|
|
|
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/xirrus-rssi.rrd";
|
|
|
|
$radios = snmpwalk_cache_oid($device, 'XIRRUS-MIB::realtimeMonitorIfaceName', array(), 'XIRRUS-MIB');
|
|
|
|
$rssi = snmpwalk_cache_oid($device, 'XIRRUS-MIB::realtimeMonitorAverageRSSI', array(), 'XIRRUS-MIB');
|
2016-05-25 19:56:10 +01:00
|
|
|
$dataRate = snmpwalk_cache_oid($device, 'XIRRUS-MIB::realtimeMonitorAverageDataRate', array(), 'XIRRUS-MIB');
|
|
|
|
$noiseFloor = snmpwalk_cache_oid($device, 'XIRRUS-MIB::realtimeMonitorNoiseFloor', array(), 'XIRRUS-MIB');
|
|
|
|
$associations=array();
|
|
|
|
|
2016-05-24 20:42:33 +01:00
|
|
|
foreach($radios as $idx => $radio) {
|
|
|
|
|
|
|
|
$radioName = $radio['realtimeMonitorIfaceName'];
|
2016-05-25 19:56:10 +01:00
|
|
|
$associations[$radioName]=0;
|
|
|
|
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/xirrus_stats-$radioName.rrd";
|
2016-05-24 20:42:33 +01:00
|
|
|
if (!is_file($rrd_filename)) {
|
2016-05-25 19:56:10 +01:00
|
|
|
rrdtool_create($rrd_filename, " --step 300 DS:rssi:GAUGE:600:-150:0 DS:dataRate:GAUGE:600:0:1400 DS:noiseFloor:GAUGE:600:-150:0".$config['rrd_rra']);
|
2016-05-24 20:42:33 +01:00
|
|
|
}
|
2016-05-25 19:56:10 +01:00
|
|
|
rrdtool_update($rrd_filename, array(
|
|
|
|
'rssi'=>$rssi[$idx]['realtimeMonitorAverageRSSI'],
|
|
|
|
'dataRate'=>$dataRate[$idx]['realtimeMonitorAverageDataRate'],
|
|
|
|
'noiseFloor'=>$noiseFloor[$idx]['realtimeMonitorNoiseFloor']
|
|
|
|
));
|
2016-05-24 20:42:33 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
// cleanup
|
|
|
|
unset($rrd_filename); unset($radios); unset($rssi); unset($radioName);
|
2016-05-25 19:56:10 +01:00
|
|
|
|
|
|
|
// station associations
|
|
|
|
// custom RRDs and graph as each AP may have 16 radios
|
|
|
|
$assoc = snmpwalk_cache_oid($device, 'XIRRUS-MIB::stationAssociationIAP', array(), 'XIRRUS-MIB');
|
|
|
|
foreach($assoc as $s) {
|
|
|
|
$radio = array_pop($s);
|
|
|
|
$associations[$radio]++;
|
|
|
|
}
|
|
|
|
unset($radio); unset($assoc);
|
|
|
|
// write to rrds
|
|
|
|
print_r($associations);
|
|
|
|
foreach($associations as $radio => $count) {
|
|
|
|
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/xirrus_users-$radio.rrd";
|
|
|
|
if (!is_file($rrd_filename)) {
|
|
|
|
rrdtool_create($rrd_filename, " --step 300 DS:stations:GAUGE:600:0:3200".$config['rrd_rra']);
|
|
|
|
}
|
|
|
|
rrdtool_update($rrd_filename, array('stations'=>$count));
|
|
|
|
}
|
|
|
|
// cleanup
|
|
|
|
unset($assocations); unset($rrd_filename);
|
|
|
|
|
2016-05-24 20:42:33 +01:00
|
|
|
$graphs['xirrus_rssi'] = TRUE;
|
2016-05-25 19:56:10 +01:00
|
|
|
$graphs['xirrus_dataRates'] = TRUE;
|
|
|
|
$graphs['xirrus_noiseFloor'] = TRUE;
|
|
|
|
$graphs['xirrus_stations'] = TRUE;
|