Energy efficiency has become an encouragement, and more than this, a requisite for the design of next-generation wireless communications standards. In current work, a dual-hop cognitive (secondary) relaying system is considered, incorporating multiple amplify-and-forward relays, a rather cost-effective solution. First, the secondary relays sense the wireless channel, scanning for a primary network activity, and then convey their reports to a secondary base station (SBS). Afterwards, the SBS, based on these reports and its own estimation, decides cooperatively the presence of primary transmission or not. In the former scenario, all the secondary nodes start to harvest energy from the transmission of primary node(s). In the latter scenario, the system initiates secondary communication via a best relay selection policy. Performance evaluation of this system is thoroughly investigated, by assuming realistic channel conditions, i.e., non-identical link-distances, Rayleigh fading, and outdated channel estimation. The detection and outage probabilities as well as the average harvested energy are derived as new closed-form expressions. In addition, an energy efficiency optimization problem is analytically formulated and solved, while a necessary condition in terms of power consumption minimization for each secondary node is presented. From a green communications standpoint, it turns out that energy harvesting greatly enhances the resources of secondary nodes, especially when primary activity is densely present.