dgarage / NBXplorer

NBitcoin Explorer
MIT License
319 stars 212 forks source link

implement a /status route #123

Open ketominer opened 6 years ago

ketominer commented 6 years ago

It would be great to have a /status or /health route to check if the service is running properly using monitoring tools (nagios, zabbix or else)

NicolasDorier commented 6 years ago

What Service running properly means? What you probably want is to use the already existing {cryptoCode}/status to be sure the node of a specific coin is running properly.

ketominer commented 6 years ago

Maybe a loop on all the {cryptoCode}s? The idea is to have a unique endpoint not depending on which/how many coins are configured. But it's very low priority, I didn't know about the {cryptoCode}/status route so I can definitely use this in a manual setup :)

NicolasDorier commented 6 years ago

Look at this https://github.com/dgarage/NBXplorer/blob/master/docs/API.md#get-connection-status-to-the-chain

ketominer commented 6 years ago

Looks good! Does it return something else than 200 if not synced? Or do I have the parse the body?

NicolasDorier commented 6 years ago

yep you need parse the body... or develop another route yourself. :p

ketominer commented 6 years ago

nice try to make me do some dotnet :p

NicolasDorier commented 6 years ago

First try is free.

image