The problem of finding efficient maintenance and inspection schemes in the case of components with a stochastic life time is studied and a mixed integer programming solution is proposed. The problem is compared with the two simpler problems of which the studied problem is a generalisation: The opportunistic replacement problem, assuming components with a deterministic life time and The opportunistic replacement problem for components with a stochastic life time, for maintenance schemes without inspections.