'state', // ? //'truthvalue' => 'state', // ? 'volts' => 'voltage', 'rpm' => 'fanspeed', 'celsius' => 'temperature', 'dBm' => 'dbm' ]; foreach ($sensor_array as $index => $entry) { if (isset($sensor_classes[$entry['deviceSensorUnits']]) && is_numeric($entry['deviceSensorValue']) && is_numeric($index) && $entry['deviceSensorStatus'] !== 'unavailable' && $entry['deviceSensorStatus'] !== 'nonoperational') { $descr = rewrite_entity_name($entry['deviceSensorName']); $oid = ".1.3.6.1.4.1.3417.2.1.1.1.1.1.5." . $index; $class = $sensor_classes[$entry['deviceSensorUnits']]; $scale = si_to_scale($entry['deviceSensorScale']); $value = $entry['deviceSensorValue']; $oid_name = 'bluecoat-sg-proxy-mib'; if ($class === 'temperature' && ($value * $scale) > 200) { continue; } // only why not possible convert to definitions if ($value == -127) { continue; } $options = []; $options['rename_rrd'] = "bluecoat-sg-proxy-mib-$index"; $options['oid_scale_si'] = "deviceSensorScale"; // need to walk this oid on every poll discover_sensor_ng($device, $class, $mib, $oid_name, $oid, $index, $descr, $scale, $value, $options); } } unset($sensor_classes, $oids, $oids_arista, $sensor_array, $index, $scale, $class, $value, $descr, $ok, $options); // EOF