In this paper, we propose an agreement-based fault detection and recovery protocol for cluster head (CH) in wireless sensor networks (WSNs). The aim of protocol is to accurately detect CH failure to avoid unnecessary energy consumption caused by a mistaken detection process. For this, it allows each cluster member to detect its CH failure independently. Cluster members employ distributed agreement protocol to reach an agreement on failure of the CH among multiple cluster members. The detection process runs concurrently with normal network operation by periodically performing a distributed detection process at each cluster member. To reduce energy consumption, it makes use of heartbeat messages sent periodically by a CH for fault detection. Our algorithm would provide high detection accuracy because of agreement protocol.