Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Produce metrics from miner apis and the Helium blockchain. We can use the metrics to diagnose, alert, and prevent poor mining performance.

NotificationsYou must be signed in to change notification settings

nhatfield/hnt_monitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Grafana style for your miner

HNT: 13Vazr2mTQSbu2wBGAkqpaLvJQEdSv5aMd3qpdXFJSw2pfNpqC4

HNT: 13Vazr2mTQSbu2wBGAkqpaLvJQEdSv5aMd3qpdXFJSw2pfNpqC4

Overview

This repo is used to produce metrics from miner api's and the Helium blockchain. We can use the metrics to diagnose, alert, and prevent poor mining performance. Currently we extract the following metrics:

Hotspot API

  • activity metrics
  • block height
  • reward counts (15 minute, 1 hour, 1 day, 7 days, 30 days)
  • reward scale
  • witnessed
  • witnesses

Bobcat API

  • block height
  • cpu temperatures
  • height gap
  • miner height
  • sync status

LongAP

  • block height
  • height gap
  • miner connected
  • miner height
  • online status
  • sync status

Nebra

  • block height
  • bluetooth connected
  • frequency
  • height gap
  • lora status
  • miner connected
  • miner height
  • relayed
  • sync percent
  • sync status

Sensecap API

  • antenna gain
  • block height
  • cpu temperature
  • cpu used
  • dialable
  • height gap
  • is healthy
  • memory total
  • memory used
  • nat type
  • miner connected
  • miner height
  • relayed
  • sd total
  • sd used
  • sync status

System Requirements

Minimum system resources to run this stack are. This will support 5 miners with decent activity

  • CoreI5
  • 6GB RAM
  • 7200 RPM Disk
  • x86 / x64 systems (no ARM support)

Prerequisite

Linux +(MacOS): Without using docker

If you plan to not use docker to manage your metric collection, you will need to have your monitoring platform setup by usingprometheus,prometheus push gateway, andgrafana. The pushgateway, from prometheus, will allow us to push metrics to prometheus instead of trying to host the metrics ourselves on an http endpoint.


Linux +(MacOS) & Windows: Using docker and docker-compose

Linux +(MacOS)

You can installdocker anddocker-compose by running thehnt_monitor.sh script. This will install all of the dependencies necessary, walk you through a setup wizard, and deploy the service. With docker we can create the entire monitoring stack usingdocker-compose.

$> ./hnt_monitor.sh

If you want to only install the dependencies and not setup and deploy, you can pass in the argumentprereq to thehnt_monitor.sh script.

$> ./hnt_monitor.sh prereq

Windows

You will need to installdocker anddocker-compose manually. You can do that by installing docker desktop for windows.


Quick Start: Linux +(MacOS) only

Linux +(MacOS): setup & installation

Thehnt_monitor.sh script will install the necessary software and walk you through setting up the monitor stack. Follow the prompts, input your miners, and let the script install the platform

$> ./hnt_monitor.sh

Deep Dive

Linux +(MacOS): Without docker

Navitage to thesrc/conf/ directory and add your miners hotspot address (the public address assigned to the miner on the blockchain "112nVe...") to theaddress.list file. Next, update thehnt_monitor.conf file with your prometheus push gateway host and port, <your_miner>_monitor=true, and supply your miners addresses. Then run the hnt monitor script manually in thesrc/bin directory. You can visit thehost:port of the machine running prometheus pushgaeway and see the new metrics.

$> ./src/bin/hnt_monitor

Run in the background if you want to make it a service

$> ./src/bin/hnt_monitor&

NOTE

  • *_addresses=          is always referring to the hotspot public address found on the blockchain and explorer. This is the long character string like112vGthen34DVHjnj...

  • *_ips=                      is always referring to the hotspot private ip addresses that is assigned by your internal router.192.168.2.1

  • *_serial_numbers  is always referring to the hotspot unique id identifier that your vendor has supplied

You can add multiple miners by quoting and separating with a space."address1 address2 address3"



Linux +(MacOS) & Windows: docker without docker-compose

Run the hnt monitor script standalone

$> docker build -t hnt_monitor -f build/docker/Dockerfile.$> docker run --rm -it hnt_monitorhelp# help menu$> docker run -d -e HNT_HOTSPOT_MONITOR=true -e HNT_HOTSPOT_ADDRESSES="12345..." -e HNT_PROMETHEUS_PG_HOST=http://my.prometheus-pushgateway.host:9091 hnt_monitor# Enable hotspot monitoring from helium api

Linux +(MacOS) & Windows: docker with docker-compose

Linux +(MacOS): Automated Setup & Deploy

Run thehnt_monitor.sh script to configure the docker-compose settings and launch the stack.

$> ./hnt_monitor.sh

Linux +(MacOS) & Windows: Manual Setup & Deploy

Edit thehnt_monitor.yml file and add your miner information to thehnt_monitor service environment variables.

  hnt_monitor:    container_name: hnt_monitor    image: hnt_monitor:latest    build:      dockerfile: ./build/docker/Dockerfile      context:.    environment:      DO_NOT_REMOVE:"setup"      HNT_HOTSPOT_MONITOR:"true"      HNT_HOTSPOT_ADDRESSES:"<myminersaddress>"# Update your miner address on this line before launching the stack      HNT_PROMETHEUS_PG_HOST:"http://prometheus_pushgateway:9091"      HNT_DEBUG:"true"    networks:      hnt_monitor:        ipv4_address: 10.30.0.05    depends_on:      - prometheus_pushgateway

Check the variables table below for more options that thehnt_monitor supports. Once you're satisfied, you can run thedocker-compose,up command, below to launch the stack.

$> docker-compose -f hnt_monitor.yml up -d --build

Oncedocker-compose completes, you can verify the endpoints in your browser. Open your favorite web browser and check the following endpoints

ApplicationEndpoint
grafanahttp://localhost:3000
prometheushttp://localhost:9090
prometheus pushgatewayhttp://localhost:9091

Upgrading

Linux +(MacOS): Automated Upgrade

Using thehnt_monitor.sh you can provide theupdate command to pull down the latest release and deploy. This will automatically reset any local changes you have made so be sure to copy your work to another directory if you have done your own development. Youdo not need to worry about thehnt_monitor.yml changess that exist. Thehnt_monitor.sh script will use its own .yml file

$> ./hnt_monitor.sh update

Linux +(MacOS) & Windows: Manual updates

If you have to update manually there are a couple of things you need to do so you dont lose your settings. Make sure to do the following to update your version safely.

  • Copy the existinghnt_monitor.yml to another directory
  • Git pull the repo down and checkout the release version or download and unzip the release
  • Copy yourhnt_monitor.yml to the new release
  • Then rundocker-compose -f hnt_monitor.yml up -d --build

Verify Installtation

Check the prometheus push gateway to see metrics have been pushed from thehnt_monitor. This service is listening 9091, navigate tohttp://localhost:9091 in your browser. You should see a screen like below, with all of the available metrics from the miner collector.


NOTE

Initial etl processing takes up to 2 minutes to push data. Please allow time for the metrics to be pushed before verification.


prometheuspg

Docker Logs

$> docker logs -f hnt_monitor

Help

$> docker run -it --rm hnt_monitorhelp

Variables

NameDefaultDescriptionRequired
HNT_BLOCKS_URLapi.helium.io/v1/blocksThe helium blocks api url.no
HNT_BOBCAT_IPSIf bobcat monitoring enabled, list of ips. Ex: '192.x.x.2 192.x.x.3 192.x.x.etc'no
HNT_BOBCAT_MONITORfalseEnable or disable bobcat monitoring. Boolean:(true or false)no
HNT_DEBUGfalseTurn on debug logging. Boolean:(true or false)no
HNT_HELIUM_MONITORtrueEnable or disable helium monitoring. Boolean:(true or false)no
HNT_HOTSPOT_ADDRESSESHotspot miner addresses to get metrics from. Ex: 'address1 address2 address3 etc'no
HNT_HOTSPOT_MONITORfalseEnable hotspot monitoring from helium api. Boolean:(true or false)no
HNT_HOTSPOT_URLapi.helium.io/v1/hotspotsThe helium hotspot api url.no
HNT_LOGFILEstdoutSend logs to this fileno
HNT_LOGPATH/dev/Send logs to this pathno
HNT_LONGAP_ADDRESSESIf longap monitoring enabled, list of ips. Ex: 'address1 address2 address3'no
HNT_LONGAP_MONITORfalseEnable or disable bobcat monitoring. Boolean:(true or false)no
HNT_NEBRA_IPSIf nebra monitoring enabled, list of ips. Ex: '192.x.x.2 192.x.x.3 192.x.x.etc'no
HNT_NEBRA_MONITORfalseEnable or disable nebra monitoring. Boolean:(true or false)no
HNT_PROJECThnt_monitorThe name of the metric prefix when sending to prometheus.no
HNT_PROMETHEUS_PG_HOSThttp://localhost:9091The prometheus push gateway hostname.yes
HNT_SENSECAP_API_KEYApi key for sensecapno
HNT_SENSECAP_MONITORfalseEnable or disable sensecap monitoring. Boolean:(true or false)no
HNT_SENSECAP_SERIAL_NUMBERSIf sensecap monitoring enabled, list of Serial numbers of the sensecap minersno
HNT_TRACEfalseTurn on trace logging. Produces more logs than debug. Boolean:(true or false)no

What's next


Tips & Donations

Always welcomed, never required =)

HNT: 13Vazr2mTQSbu2wBGAkqpaLvJQEdSv5aMd3qpdXFJSw2pfNpqC4

HNT: 13Vazr2mTQSbu2wBGAkqpaLvJQEdSv5aMd3qpdXFJSw2pfNpqC4

About

Produce metrics from miner apis and the Helium blockchain. We can use the metrics to diagnose, alert, and prevent poor mining performance.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp