Fix OS sensor array return (#12694)
This commit is contained in:
parent
b9b7a8caa9
commit
53d46044c3
|
@ -49,6 +49,8 @@ class AirosAfLtu extends OS implements
|
|||
new WirelessSensor('distance', $this->getDeviceId(), '.1.3.6.1.4.1.41112.1.10.1.4.1.23.' . $index, 'airos-af-ltu', 1, 'Distance', $entry['afLTUStaRemoteDistance'], 1, 1000), //UBNT-AFLTU-MIB::afLTUStaRemoteDistance
|
||||
];
|
||||
}
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -109,7 +109,6 @@ class Routeros extends OS implements
|
|||
{
|
||||
$data = $this->fetchData();
|
||||
|
||||
$sensors = [];
|
||||
foreach ($data as $index => $entry) {
|
||||
if ($entry['mtxrWlApFreq'] == null) {
|
||||
return $this->discoverSensor(
|
||||
|
@ -125,6 +124,8 @@ class Routeros extends OS implements
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -249,7 +250,7 @@ class Routeros extends OS implements
|
|||
return $sensors;
|
||||
}
|
||||
|
||||
private function discoverSensor($type, $oid, $num_oid_base)
|
||||
private function discoverSensor($type, $oid, $num_oid_base): array
|
||||
{
|
||||
$data = $this->fetchData();
|
||||
$sensors = [];
|
||||
|
|
|
@ -120,11 +120,6 @@ parameters:
|
|||
count: 2
|
||||
path: LibreNMS/Modules/Mpls.php
|
||||
|
||||
-
|
||||
message: "#^Method LibreNMS\\\\OS\\\\AirosAfLtu\\:\\:discoverWirelessDistance\\(\\) should return array but return statement is missing\\.$#"
|
||||
count: 1
|
||||
path: LibreNMS/OS/AirosAfLtu.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#8 \\$multiplier of class LibreNMS\\\\Device\\\\WirelessSensor constructor expects int, null given\\.$#"
|
||||
count: 2
|
||||
|
@ -145,11 +140,6 @@ parameters:
|
|||
count: 1
|
||||
path: LibreNMS/OS/Ios.php
|
||||
|
||||
-
|
||||
message: "#^Method LibreNMS\\\\OS\\\\Routeros\\:\\:discoverWirelessFrequency\\(\\) should return array but return statement is missing\\.$#"
|
||||
count: 1
|
||||
path: LibreNMS/OS/Routeros.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#8 \\$multiplier of class LibreNMS\\\\Device\\\\WirelessSensor constructor expects int, null given\\.$#"
|
||||
count: 1
|
||||
|
|
Loading…
Reference in New Issue