A machine under random environmental conditions producing shocks and wear is studied under matrix‐analytic methods. There is dependence in the interarrival times of shocks. Different types of failure producing damage in the internal and external structure of the machine are considered. Maintenance is performed by repair and replacement. Explicit expressions for the main reliability performance measures are given.