The ever growing complexity of modern data networks requires versatile and scalable network monitoring architectures. In this paper we propose a network monitoring system with a peer-to-peer (P2P) architecture, allowing for high tolerance to failures and distributed storage of measured data. We describe the main features of the architecture, namely the system elements and its hierarchical organization, the protocols for handshaking, promoting and demotion of system elements, and distributing control information, the algorithm for system startup, addition of new elements and failure recovery, and the procedures for storing, replicating, searching and downloading measurement data. The proposed architecture is shown to be flexible in adapting to various network conditions and available resources.