Skip to content

Instantly share code, notes, and snippets.

View Stadicus's full-sized avatar

Stadicus Stadicus

View GitHub Profile
@Stadicus
Stadicus / bitcoin-monitor.md
Last active December 19, 2022 19:58 — forked from ageis/bitcoin-monitor.md
Prometheus exporter for monitoring statistics of Bitcoin daemon

bitcoind-monitor.py

Updated to work with Bitcoin Core 16.0 and newer.

This is a script written in Python intended to run alongside a Bitcoin node and export statistics for monitoring purposes. It assumes the existence of bitcoin-cli in the PATH and access to the RPC interface over localhost.

It tracks stuff like: block height, difficulty, number of peers, network hash rate, errors, uptime in seconds, mempool size, size of recent blocks, number of transactions within blocks, chaintips, total bytes received and sent, and transaction inputs and outputs. These Bitcoin metrics are refreshed once every 5 minutes.

How it works