Due to advances in technology, research in healthcare using a cyber-physical system (CPS) opens innovative dimensions of services. In this paper, the authors propose an energy- and service-level agreement (SLA)-efficient cyber physical system for E-healthcare during data transmission services. Furthermore, the proposed phenomenon will be enhanced to ensure the security by detecting and eliminating the malicious devices/nodes involved during the communication process through advances in the ad hoc on-demand distance vector (AODV) protocol. The proposed framework addresses the two security threats, such as grey and black holes, that severely affect network services. Furthermore, the proposed framework used to find the different network metrics such as average qualifying service set (QSS) paths, mean hop and energy efficiency of the quickest path. The framework is simulated by calculating the above metrics in mutual cases i.e., without the contribution of malevolent nodes and with the contribution of malevolent nodes over service time, hop count and energy constraints. Further, variation of SLA and energy shows their expediency in the selection of efficient network metrics.