$value) { if ($key == "Battery Status") { $value = str_replace('%', '', $value); discover_sensor('capacity', $device, '', 0, 'areca', "Areca Battery Status", 1, $value, [], 'agent'); $agent_sensors['capacity']['areca'][0] = ['description' => "Areca Battery Status", 'current' => $value, 'index' => 0]; } elseif ($key == "Fan#1 Speed (RPM)") { // Currently doesn't handle more than one fan (but I know of no Areca controllers with >1 fan) // Could be done with a regex like below. discover_sensor('fanspeed', $device, '', 1, 'areca', "Areca Fan #1", 1, $value, [], 'agent'); $agent_sensors['fanspeed']['areca'][1] = ['description' => "Areca Fan #1", 'current' => $value, 'index' => 1]; } elseif (preg_match("/^HDD\ .*\ Temp\./", $key)) { // Temperature value. Currently not handled as this can be retrieved over SNMP, unlike fan and battery status (for SATA controllers). } } unset($areca); } // EOF