The maintenance of diesel Engines is usually scheduled according to the maintenance procedures defined by manufacturers. However, the state of the art shows that the condition monitoring maintenance associated with adequate prediction algorithms allows performance improvement both by increasing the intervals between interventions and by helping to maintain reliability levels. There are many types of variables that can be used to measure equipment condition, as is the case of several types of pollutant emissions such as NOx, CO2, HC, PM, and NOISE, among others. This is a typical problem that can be solved through a hidden Markov model, taking into account the specificity of this type of equipment. The paper describes two algorithms that can help to increase the quality of assessment of engine states and the efficiency of maintenance planning. Those are the Viterbi and Baum–Welch algorithms. The importance of how to calculate the performance index of the model by the use of the perplexity algorithm is also emphasized. In this paper, a new paradigm is proposed, designated as ecological predictive maintenance. Copyright © 2017 John Wiley & Sons, Ltd.