= '1') { echo 'Checking RouterOS Wireless clients... '; $wificlients1 = snmp_get($device, 'mtxrWlApClientCount', '-OUqnv', 'MIKROTIK-MIB'); echo (($wificlients1 + 0)." clients\n"); break; } unset($wirelesscards); } } elseif ($device['os'] == 'symbol' and (stristr($device['hardware'], 'AP'))) { echo 'Checking Symbol Wireless clients... '; $wificlients1 = snmp_get($device, '.1.3.6.1.4.1.388.11.2.4.2.100.10.1.18.1', '-Ovq', '""'); echo (($wificlients1 + 0).' clients on wireless connector, '); } elseif ($device['os'] == 'unifi') { echo 'Checking Unifi Wireless clients... '; $clients = snmp_walk($device, 'unifiVapNumStations', '-Oqv', 'UBNT-UniFi-MIB'); $bands = snmp_walk($device, 'unifiVapRadio', '-Oqv', 'UBNT-UniFi-MIB'); $clients = explode("\n", $clients); $bands = explode("\n", $bands); foreach ($bands as $index => $band_index) { if ($band_index == "ng") { $wificlients1 = $wificlients1 + $clients[$index] + 0; } else { $wificlients2 = $wificlients2 + $clients[$index] + 0; } } echo (($wificlients1 + 0).' clients on Radio0, '.($wificlients2 + 0)." clients on Radio1\n"); include 'includes/polling/mib/ubnt-unifi-mib.inc.php'; } // Loop through all $wificlients# and data_update() $i = 1; while (is_numeric(${'wificlients'.$i})) { $tags = array( 'rrd_def' => 'DS:wificlients:GAUGE:600:-273:1000', 'rrd_name' => array('wificlients', "radio$i"), 'radio' => $i, ); data_update($device, 'wificlients', $tags, ${'wificlients'.$i}); $graphs['wifi_clients'] = true; unset(${'wificlients'.$i}); $i++; } }//end if echo "\n";