diff --git a/LibreNMS/Enum/Sensor.php b/LibreNMS/Enum/Sensor.php index 22ba46f2c3fc1030d38a9481c5bfc2bb0309ba89..3762f7be1750f09c5b981e3557bbdd56b1767930 100644 --- a/LibreNMS/Enum/Sensor.php +++ b/LibreNMS/Enum/Sensor.php @@ -159,7 +159,7 @@ enum Sensor: string */ public function getPollingInterface(): string { - return match($this) { + return match ($this) { self::AIRFLOW => \LibreNMS\Interfaces\Polling\Sensors\SensorAirflowPolling::class, self::BER => \LibreNMS\Interfaces\Polling\Sensors\SensorBerPolling::class, self::BITRATE => \LibreNMS\Interfaces\Polling\Sensors\SensorBitratePolling::class, diff --git a/LibreNMS/Modules/Sensors.php b/LibreNMS/Modules/Sensors.php index 253db52f9ff43e69763b4eb536c6be4fcd371dbe..b138e601e1a4248779b746c77af0257e37cdb7c5 100644 --- a/LibreNMS/Modules/Sensors.php +++ b/LibreNMS/Modules/Sensors.php @@ -1,4 +1,5 @@ sync(sensor_class: $sensor_class, poller_type: 'snmp'); // $this->syncModelsByGroup($os->getDevice(), 'sensors', $sensors, ['sensor_class' => $type]); @@ -126,6 +126,7 @@ class Sensors implements \LibreNMS\Interfaces\Module // fetch data for all non-custom polled sensors $oids = $all_sensors->filter(function ($sensor, $sensor_class) use ($os) { $polling_interface = Sensor::from($sensor_class)->getPollingInterface(); + return ! $os instanceof $polling_interface; })->flatten()->pluck('sensor_oid')->unique()->all(); @@ -253,7 +254,7 @@ class Sensors implements \LibreNMS\Interfaces\Module 'state_translation_id', 'state_index_id', 'sensors_to_state_translations_id', - 'lastupdate' + 'lastupdate', ]), 'state_indexes' => StateIndex::join('state_translations', 'state_indexes.state_index_id', '=', 'state_translations.state_index_id') ->joinSub( @@ -275,7 +276,7 @@ class Sensors implements \LibreNMS\Interfaces\Module 'state_translations.state_draw_graph', 'state_translations.state_value', 'state_translations.state_generic_value', - ]) + ]) ->get(), ]; } diff --git a/LibreNMS/OS/Shared/Radlan.php b/LibreNMS/OS/Shared/Radlan.php index 49568cfd41aca13a8709b6092c163e4b00e3f0ca..17844cebae9d0c82aa77137af17b19d926c32285 100644 --- a/LibreNMS/OS/Shared/Radlan.php +++ b/LibreNMS/OS/Shared/Radlan.php @@ -28,40 +28,40 @@ class Radlan extends OS implements ProcessorDiscovery } /** - Temperature OID - - .1.3.6.1.4.1.89.53.15.1.9 - .1.3.6.1.4.1.89.53.15.1.10 - - CPU OIDs - - .1.3.6.1.4.1.89.1.6 - .1.3.6.1.4.1.89.1.7 - .1.3.6.1.4.1.89.1.8 - .1.3.6.1.4.1.89.1.9 - - Memory OIDs - - .1.3.6.1.4.1.89.29.11.1 - .1.3.6.1.4.1.89.29.11.2 - - P.S. OIDs - - .1.3.6.1.4.1.89.35.5.1.1.2 - .1.3.6.1.4.1.89.83.1.2.1.2 - .1.3.6.1.4.1.89.83.1.2.1.3 - .1.3.6.1.4.1.89.83.1.2.1.4 - .1.3.6.1.4.1.89.53.15.1.3 - .1.3.6.1.4.1.89.53.15.1.3 - - Fan OIDs - - .1.3.6.1.4.1.89.83.1.1.1.2 - .1.3.6.1.4.1.89.83.1.1.1.3 - .1.3.6.1.4.1.89.53.15.1.4 - .1.3.6.1.4.1.89.53.15.1.5 - .1.3.6.1.4.1.89.53.15.1.6 - .1.3.6.1.4.1.89.53.15.1.7 - .1.3.6.1.4.1.89.53.15.1.8 + * Temperature OID + * + * .1.3.6.1.4.1.89.53.15.1.9 + * .1.3.6.1.4.1.89.53.15.1.10 + * + * CPU OIDs + * + * .1.3.6.1.4.1.89.1.6 + * .1.3.6.1.4.1.89.1.7 + * .1.3.6.1.4.1.89.1.8 + * .1.3.6.1.4.1.89.1.9 + * + * Memory OIDs + * + * .1.3.6.1.4.1.89.29.11.1 + * .1.3.6.1.4.1.89.29.11.2 + * + * P.S. OIDs + * + * .1.3.6.1.4.1.89.35.5.1.1.2 + * .1.3.6.1.4.1.89.83.1.2.1.2 + * .1.3.6.1.4.1.89.83.1.2.1.3 + * .1.3.6.1.4.1.89.83.1.2.1.4 + * .1.3.6.1.4.1.89.53.15.1.3 + * .1.3.6.1.4.1.89.53.15.1.3 + * + * Fan OIDs + * + * .1.3.6.1.4.1.89.83.1.1.1.2 + * .1.3.6.1.4.1.89.83.1.1.1.3 + * .1.3.6.1.4.1.89.53.15.1.4 + * .1.3.6.1.4.1.89.53.15.1.5 + * .1.3.6.1.4.1.89.53.15.1.6 + * .1.3.6.1.4.1.89.53.15.1.7 + * .1.3.6.1.4.1.89.53.15.1.8 */ }