mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
newdevice: Aruba Instant AP wireless sensor support (Freq, NoiseFloor, Power, Util) (#6564)
A few other fixes elsewhere
This commit is contained in:
committed by
Neil Lathwood
parent
2b3ca49bea
commit
35414a73c7
@@ -95,7 +95,6 @@ class Sensor implements DiscoveryModule, PollerModule
|
||||
$entPhysicalIndex = null,
|
||||
$entPhysicalMeasured = null
|
||||
) {
|
||||
//
|
||||
$this->type = $type;
|
||||
$this->device_id = $device_id;
|
||||
$this->oids = (array)$oids;
|
||||
@@ -113,6 +112,11 @@ class Sensor implements DiscoveryModule, PollerModule
|
||||
$this->high_warn = $high_warn;
|
||||
$this->low_warn = $low_warn;
|
||||
|
||||
// ensure leading dots
|
||||
array_walk($this->oids, function (&$oid) {
|
||||
$oid = '.' . ltrim($oid, '.');
|
||||
});
|
||||
|
||||
$sensor = $this->toArray();
|
||||
// validity not checked yet
|
||||
if (is_null($this->current)) {
|
||||
@@ -547,10 +551,10 @@ class Sensor implements DiscoveryModule, PollerModule
|
||||
{
|
||||
$table = static::$table;
|
||||
$params = array($device_id, $type);
|
||||
$where = '`device_id`=? AND `sensor_class`=? AND `sensor_id`';
|
||||
$where = '`device_id`=? AND `sensor_class`=?';
|
||||
|
||||
if (!empty($sensor_ids)) {
|
||||
$where .= ' NOT IN ' . dbGenPlaceholders(count($sensor_ids));
|
||||
$where .= ' AND `sensor_id` NOT IN ' . dbGenPlaceholders(count($sensor_ids));
|
||||
$params = array_merge($params, $sensor_ids);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user