Diagnosis and prognosis are necessary tasks for system reconfiguration and fault-adaptive control in complex systems. Diagnosis consists of detection, isolation and identification of faults, while prognosis consists of prediction of the remaining useful life of systems. This paper presents an integrated model-based distributed diagnosis and prognosis framework, where system decomposition is used to perform the diagnosis and prognosis tasks in a distributed way. We show how different submodels can be automatically constructed to solve the local diagnosis and prognosis problems. We illustrate our approach using a simulated four-wheeled rover for different fault scenarios. Our experiments showed that our approach correctly performs fault diagnosis and prognosis in an efficient and robust manner.