We address the problem of determining inspection and maintenance strategy for a system whose state is described by a multivariate stochastic process. We relax and extend the usual approaches. The system state is a multivariate stochastic process, decisions are based on a performance measure defined by the values of a functional on the process, and the replacement decision is based on the crossings of a critical levels. The critical levels are defined for the performance measure itself and also as the probability of never returning to a satisfactory level of performance. The inspection times are determined by a deterministic function of the system state. A non-periodic policy is developed by evaluating the expected lifetime costs and the optimal policy by an optimal choice of inspection function. The model thus gives a guaranteed level of reliability throughout the life of the project. In the particular case studied here, the underlying process is a multivariate Wiener process, the performance measure is the l2 norm, and the last exit time from a critical set rather than the first hitting time determines the policy.