An essential goal of reliability engineering is maintaining technical systems optimally, ensuring continuous operation. Random inspections of working systems are crucial in some industries to meet safety and quality standards. This paper proposes an opportunistic optimal age-based preventive maintenance (PM) strategy for n-component (n > 1) coherent systems compromising redundant components. The system begins operating at t = 0, with a PM time scheduled at T-PM. To reduce the risk of unexpected and catastrophic failures, the system is inspected at a random time X before T-PM. Based on the information about the number of failed components, m, the operator decides whether to perform the PM action early at X or to allow the system to continue operating on (X, T-PM). By incorporating a cost function that considers cost parameters related to failures, we determine the optimal values for the decision variables T(PM )and m. The paper's results rely on the notion of the system signature as a powerful tool to represent the reliability of n-component systems. To evaluate the effectiveness of the proposed model, we conduct a comprehensive analysis of coherent systems using graphical and numerical examples. In particular, we consider a well-investigated parallel system related to the generator parts in a wind turbine. Using a data set related to the failure times of generators, the applicability of the proposed PM policy is illustrated.