Energy harvesting wireless networks have become a reality in recent years. Designing policies that store and utilize the harvested energy, for achieving the desired network performance, remains one of the key challenges in such networks. To this end, based on the quality of monitoring, we formulate a long-Term time-Averaged joint scheduling and sensing allocation problem in wireless sensor networks with finite energy and data buffers, subject to certain data and battery quality-of-service constraints. Relaxing the finite energy buffer assumption, using virtual queues and techniques from Lyapunov optimization, we obtain the JSSA algorithm. We show that by appropriately choosing the control parameter of the JSSA algorithm, we can achieve a performance gap that decays inversely proportional to the battery capacity. The implementation overhead of the JSSA algorithm scales as O(n). Therefore, we also present a low-complexity distributed version of this algorithm whose implementation overhead scales as O(\log n). © 1983-2012 IEEE.