Preventive maintenance (age replacement) of items operating in a random environment modeled by a Poisson shock process, resulting in random jump process in the system failure rate, is considered. The corresponding univariate and bivariate models are described. In the univariate model, an item is replaced either on failure or on the predetermined replacement time, whichever comes first. In the bivariate model, the preventive maintenance is performed also on the occurrence of the mth shock. Each shock in our stochastic model has a triple effect. On one hand, it acts directly on the failure rate of an item, increasing it by a random amount or resulting in a failure. On the other hand, each shock causes additional ‘damage’, which can be attributed, eg, to a short drop in the output of an item. The corresponding optimization problem is formulated and illustrated by detailed numerical examples.