Sign inSign up

nhatfield/hnt_monitor

By nhatfield

Updated over 4 years ago

HNT Miner Metric Collector

Image
0

5.6K

nhatfield/hnt_monitor repository overview

HNT Miner Monitor

(https://github.com/nhatfield/hnt_monitor)

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
  • block height
  • reward counts (15 minute, 1 hour, 1 day, 7 days, 30 days)
  • reward scale
  • witnessed
  • witnesses

Bobcat API

  • block height
  • cpu temperatures
  • miner height
  • height gap
  • 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

PreReq's

Quick Start

Run the hnt monitor script standalone

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

Help Menu

$> docker run -it --rm hnt_monitor help

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_HOSTlocalhostThe prometheus push gateway hostname.yes
HNT_PROMETHEUS_PG_PORT9091The prometheus push gateway port.no
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

Tips & Donations

Always welcomed, never required =)

HNT: 13Vazr2mTQSbu2wBGAkqpaLvJQEdSv5aMd3qpdXFJSw2pfNpqC4

Tag summary

Content type

Image

Digest

Size

325.8 MB

Last updated

over 4 years ago

docker pull nhatfield/hnt_monitor