Distributed fault detection in sensor networks via clustering and consensus