A fog computing approach for predictive maintenance