Skip to content

πŸƒ A comprehensive monitoring and alerting solution for the status of your Chia farmer and harvesters.

License

Notifications You must be signed in to change notification settings

oboje/chia-monitor

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

42 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

chia-monitor

A monitoring tool to collect all important metrics from your Chia farming node and connected harvesters. It can send you push notifications with regular status updates and will alert you in case something goes wrong or a proof is found. All metrics are exported to a Prometheus compatible /metrics endpoint and a Grafana dashboard is also provided:

grafana

This example dashboard displays almost all collected metrics and can be imported from grafana.com using the ID 14544 or using the grafana/dashboard.json from this repository.

Notifications

To use notifications, please configure a status_service_url and alert_service_url for your desired notification service in the config.json. You can use most popular notifications services by creating a service specific webhook URL, following the instructions from this wiki.

Following notifications are currently sent to the status_service_url:

Farm summary (configurable interval in config.json)

** πŸ‘¨β€πŸŒΎ Farm Status πŸ‘©β€πŸŒΎ **
🌾 Plot Count: 2217
🧺 Plot Size: 219.451 TiB
βŒ›οΈ Signage Points Per Minute: 6.42
πŸ”Ž Passed Filters Per Minute: 29.90
βœ… Proofs found: 1
πŸ’° Total Balance: 2.00001 XCH
πŸ•°οΈ Expected Time To Win: 3 weeks and 3 days
πŸ’Ύ Current Netspace: 23.938 EiB
πŸ”οΈ Peak Height: 440778
πŸ“Ά Full Node Peer Count: 8
πŸ”„ Synced: True

Following notifications are currently sent to the alert_service_url:

Proof found alert

** πŸ€‘ Proof found! πŸ€‘ **
Your farm found a new proof

Sync lost alert

** 🚨 Farmer Lost Sync! 🚨 **
It seems like your farmer lost its connection to the Chia Network

Sync recovery alert

** βœ… Farmer Synced! βœ… **
Your farmer is successfully synced to the Chia Network again

Plots lost alert

** 🚨 Farmer Lost Plots! 🚨 **
It seems like your farmer lost some plots
Expected: 130, Found: 124

Plots recovery alert

** βœ… Farmer Plots recoverd! βœ… **
Your farmer's plot count has recovered to its previous value

Metrics

The following statistics are collected from your local Chia node using the RPC and WebSocket APIs and are then exported via a Prometheus compatible /metrics HTTP endpoint on port 8000.

Supported wallet metrics

  • Total balance (chia_confirmed_total_mojos)

Supported full node metrics

  • Sync status (chia_sync_status)
  • Peak height (chia_peak_height)
  • Difficulty (chia_diffculty)
  • Total netspace (chia_network_space)
  • Connection count (chia_connections_count)

Supported harvester metrics

  • Plot count (chia_plot_count)
  • Plot size (chia_plot_size)

Supported farmer metrics

  • Received signage points (chia_signage_points)
  • Received signage point index (chia_signage_point_index)
  • Attempted challenges (chia_block_challenges)
  • Plots passed filter (chia_plots_passed_filter)
  • Proofs found (chia_proofs_found)

Prerequisites

To run this tool, we need the following things:

  • Python 3
  • Pipenv

Linux (Ubuntu)

sudo apt install python3 pipenv

Installation

  1. Clone the repository
git clone https://github.com/philippnormann/chia-monitor.git
cd chia-monitor
  1. Install the required dependecies
pipenv install 
  1. Initialize the SQLite database
pipenv run alembic upgrade head
  1. Copy the example config file
cp config-example.json config.json
  1. Open up config.json and configure it to your preferences.

Updating

  1. Pull the latest release from git
cd chia-monitor
git pull
  1. Update the required dependecies
pipenv install
  1. Upgrade the SQLite database model
pipenv run alembic upgrade head

Usage

To use the tool, run the monitor module using pipenv from the chia-monitor directory

cd chia-monitor
pipenv run python -m monitor

Note: To run the tool in the background, you can run it as a service or in a detached screen.

Remote Harvester Support

Multiple remote harvesters can be monitored using this tool. In order for this to work, you need to make sure the RPC endpoint of your harvester can be reached from the machine on which the farmer and chia-monitor are running on. Unless you have a firewall setup on your harvester, all you need to do to achieve this, is to change the self_hostname in your ~/.chia/mainnet/config/config.yaml from localhost to 0.0.0.0:

self_hostname: 0.0.0.0

Basic Prometheus Configuration

Add a block to the scrape_configs of your prometheus.yml config file:

scrape_configs:
  - job_name: chia_monitor
    static_configs:
    - targets: ['<<CHIA-MONITOR-HOSTNAME>>:8000']

and adjust the host name accordingly.

Architecture

architecture

About

πŸƒ A comprehensive monitoring and alerting solution for the status of your Chia farmer and harvesters.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.0%
  • Mako 1.0%