$api = new PHPMinerRPC($rig_cfg['http_ip'], $rig_cfg['http_port'], $rig_cfg['rpc_key']); $api->test_connection(); $active_pool = null; // Get all active devices. $devices = $api->get_devices_details(); foreach ($devices as $k => $device) { // Get device data. $gpu_id = $device['ID']; $gpu_name = trim($device['Model']); // Only process if it was configurated within the system settings. if (!isset($rig_cfg['gpu_' . $gpu_id])) { unset($devices[$k]); continue; } // Get gpu data. $info = $api->get_gpu($device['ID']); $device['gpu_info'] = current($info); $device['notify_config'] = $rig_cfg['gpu_' . $gpu_id]; // Check if gpu min temp has errors. if ($notify_gpu_min && isset($device['notify_config']['temperature']['min']) && $device['gpu_info']['Temperature'] < $device['notify_config']['temperature']['min']) { if (can_send_notification('notify_temp_min_' . $gpu_id . '_' . $rig)) { if (!isset($notifications['temp_min'])) { $notifications['temp_min'] = array(); } if (!isset($notifications['temp_min'][$rig])) { $notifications['temp_min'][$rig] = array(); } $notifications['temp_min'][$rig][$gpu_id] = 'Rig ' . $rig . ' : GPU Temperature on GPU ' . $gpu_id . ' (' . $gpu_name . ') is to low. Current value: ' . $device['gpu_info']['Temperature'] . ' min: ' . $device['notify_config']['temperature']['min']; } } else { can_send_notification('notify_temp_min_' . $gpu_id . '_' . $rig, true);