mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
fix: os type and group not being set (#5357)
This commit is contained in:
committed by
Neil Lathwood
parent
5ad8fd3c0c
commit
b3f6218359
@@ -149,7 +149,7 @@ function poll_device($device, $options)
|
||||
{
|
||||
global $config, $device, $polled_devices, $memcache;
|
||||
|
||||
$config['os'][$device['os']] = load_os($device['os']);
|
||||
load_os($device);
|
||||
|
||||
$attribs = get_dev_attribs($device['device_id']);
|
||||
$device['snmp_max_repeaters'] = $attribs['snmp_max_repeaters'];
|
||||
|
@@ -66,20 +66,21 @@ if ($device['type'] == 'network' || $device['type'] == 'firewall' || $device['ty
|
||||
echo (($wificlients1 + 0).' clients on wireless connector, ');
|
||||
} elseif ($device['os'] == 'unifi') {
|
||||
echo 'Checking Unifi Wireless clients... ';
|
||||
$wificlients1 = 0;
|
||||
$wificlients2 = 0;
|
||||
|
||||
$clients = explode("\n", snmp_walk($device, 'unifiVapNumStations', '-Oqv', 'UBNT-UniFi-MIB'));
|
||||
$bands = explode("\n", snmp_walk($device, 'unifiVapRadio', '-Oqv', 'UBNT-UniFi-MIB'));
|
||||
|
||||
$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;
|
||||
$wificlients1 += $clients[$index];
|
||||
} else {
|
||||
$wificlients2 = $wificlients2 + $clients[$index] + 0;
|
||||
$wificlients2 += $clients[$index];
|
||||
}
|
||||
}
|
||||
|
||||
echo (($wificlients1 + 0).' clients on Radio0, '.($wificlients2 + 0)." clients on Radio1\n");
|
||||
echo $wificlients1 . ' clients on Radio0, ' . $wificlients2 . " clients on Radio1\n";
|
||||
include 'includes/polling/mib/ubnt-unifi-mib.inc.php';
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user