Giter VIP home page Giter VIP logo

hnt_monitor's Introduction

HNT Miner Monitor

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 using prometheus, prometheus push gateway, and grafana. 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 install docker and docker-compose by running the hnt_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 using docker-compose.

$> ./hnt_monitor.sh

If you want to only install the dependencies and not setup and deploy, you can pass in the argument prereq to the hnt_monitor.sh script.

$> ./hnt_monitor.sh prereq

Windows

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


Quick Start: Linux +(MacOS) only

Linux +(MacOS): setup & installation

The hnt_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 the src/conf/ directory and add your miners hotspot address (the public address assigned to the miner on the blockchain "112nVe...") to the address.list file. Next, update the hnt_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 the src/bin directory. You can visit the host: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 like 112vGthen34DVHjnj...

  • *_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_monitor help     # 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 the hnt_monitor.sh script to configure the docker-compose settings and launch the stack.

$> ./hnt_monitor.sh

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

Edit the hnt_monitor.yml file and add your miner information to the hnt_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 the hnt_monitor supports. Once you're satisfied, you can run the docker-compose, up command, below to launch the stack.

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

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

Application Endpoint
grafana http://localhost:3000
prometheus http://localhost:9090
prometheus pushgateway http://localhost:9091

Upgrading

Linux +(MacOS): Automated Upgrade

Using the hnt_monitor.sh you can provide the update 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. You do not need to worry about the hnt_monitor.yml changess that exist. The hnt_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 existing hnt_monitor.yml to another directory
  • Git pull the repo down and checkout the release version or download and unzip the release
  • Copy your hnt_monitor.yml to the new release
  • Then run docker-compose -f hnt_monitor.yml up -d --build

Verify Installtation

Check the prometheus push gateway to see metrics have been pushed from the hnt_monitor. This service is listening 9091, navigate to http://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_monitor help

Variables

Name Default Description Required
HNT_BLOCKS_URL api.helium.io/v1/blocks The helium blocks api url. no
HNT_BOBCAT_IPS If bobcat monitoring enabled, list of ips. Ex: '192.x.x.2 192.x.x.3 192.x.x.etc' no
HNT_BOBCAT_MONITOR false Enable or disable bobcat monitoring. Boolean: (true or false) no
HNT_DEBUG false Turn on debug logging. Boolean: (true or false) no
HNT_HELIUM_MONITOR true Enable or disable helium monitoring. Boolean: (true or false) no
HNT_HOTSPOT_ADDRESSES Hotspot miner addresses to get metrics from. Ex: 'address1 address2 address3 etc' no
HNT_HOTSPOT_MONITOR false Enable hotspot monitoring from helium api. Boolean: (true or false) no
HNT_HOTSPOT_URL api.helium.io/v1/hotspots The helium hotspot api url. no
HNT_LOGFILE stdout Send logs to this file no
HNT_LOGPATH /dev/ Send logs to this path no
HNT_LONGAP_ADDRESSES If longap monitoring enabled, list of ips. Ex: 'address1 address2 address3' no
HNT_LONGAP_MONITOR false Enable or disable bobcat monitoring. Boolean: (true or false) no
HNT_NEBRA_IPS If nebra monitoring enabled, list of ips. Ex: '192.x.x.2 192.x.x.3 192.x.x.etc' no
HNT_NEBRA_MONITOR false Enable or disable nebra monitoring. Boolean: (true or false) no
HNT_PROJECT hnt_monitor The name of the metric prefix when sending to prometheus. no
HNT_PROMETHEUS_PG_HOST http://localhost:9091 The prometheus push gateway hostname. yes
HNT_SENSECAP_API_KEY Api key for sensecap no
HNT_SENSECAP_MONITOR false Enable or disable sensecap monitoring. Boolean: (true or false) no
HNT_SENSECAP_SERIAL_NUMBERS If sensecap monitoring enabled, list of Serial numbers of the sensecap miners no
HNT_TRACE false Turn 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

hnt_monitor's People

Contributors

nhatfield avatar nxhatfield avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

hnt_monitor's Issues

Rocky Linux - Centos Docker Installation

It looks like while Installing on Rocky Linux docker compose does not get found in the repos.

Nice work around is the following:

  1. $ sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
  2. $ sudo chmod +x /usr/local/bin/docker-compose
  3. $ sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose

Source: https://tastethelinux.com/install-docker-and-docker-compose-on-rocky-linux-8/

Still running

is this code still running with the Solana Blockchain?

Add statsd/graphite backend support

Prometheus limitations make monitoring multiple hosts cumbersome. Instead of allowing multiple miners to push the same metric with different tags, you have to create a new metric for each miner. Statsd will allow a single metric from multiple sources as long as the tags are different

Install Error

Raspberry Pi 4 with newest OS.

Error Message:
Complete!
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile

  • base: ftp.osuosl.org
  • centos-kernel: mirror.12z.eu
  • extras: ftp.osuosl.org
  • updates: ftp.osuosl.org
    No package epel-release available.
    Error: Nothing to do
    ERROR: Service 'hnt_monitor' failed to build: The command '/bin/sh -c yum update -y && yum -y install epel-release && yum update -y && yum install -y jq && mkdir -p /opt/hnt_monitor && rm -rf /tmp/* && yum clean all -y' returned a non-zero code: 1
    root@raspberrypi:/home/pi/hnt_monitor#

help please, wrong rewards

hope anyone can help me why reward values are wrong for me
hnt_miner_reward_earned_15m to 30 days is 0 or either 1

hnt_miner_reward_earned_1d is 0.0181 same as 7d and 30d... all 3 values are wrong

other stuff is correct like CPU temp, usage, reward scale and so on but rewards are very wrong

Settings in Docker on a synology diskstation

I have the Docker version running on my synology diskstation, but unfortunately I can't get to the panel
Application endpoint
grafana http: // localhost: 3000

prometheus http: // localhost: 9090

prometheus pushgateway http: // localhost: 9091

nhatfield-hnt_monitor1

date stream content
2021-10-03 09:20:50 stdout 2021-10-03T09:20:50 [INFO]: [etl.block.height] - Sending data to prometheus pushgateway
2021-10-03 09:20:49 stdout 2021-10-03T09:20:49 [INFO]: [etl.block.height] - processing data
2021-10-03 09:19:50 stdout 2021-10-03T09:19:50 [INFO]: [collector.height] - Block height data ready to process
2021-10-03 09:19:50 stdout 2021-10-03T09:19:50 [INFO]: [etl.block.height] - Sending data to prometheus pushgateway
2021-10-03 09:19:49 stdout 2021-10-03T09:19:49 [INFO]: [etl.block.height] - processing data
2021-10-03 09:19:49 stdout 2021-10-03T09:19:49 [INFO]: [collector.height] - getting block height data
2021-10-03 09:18:50 stdout 2021-10-03T09:18:50 [INFO]: [etl.block.height] - Sending data to prometheus pushgateway
2021-10-03 09:18:49 stdout 2021-10-03T09:18:49 [INFO]: [etl.block.height] - processing data
2021-10-03 09:17:50 stdout 2021-10-03T09:17:50 [INFO]: [collector.height] - Block height data ready to process
2021-10-03 09:17:50 stdout 2021-10-03T09:17:49 [INFO]: [etl.block.height] - Sending data to prometheus pushgateway
2021-10-03 09:17:49 stdout 2021-10-03T09:17:49 [INFO]: [etl.block.height] - processing data
2021-10-03 09:17:49 stdout 2021-10-03T09:17:49 [INFO]: [collector.height] - getting block height data
2021-10-03 09:16:49 stdout 2021-10-03T09:16:49 [INFO]: [etl.block.height] - Sending data to prometheus pushgateway
2021-10-03 09:16:49 stdout 2021-10-03T09:16:49 [INFO]: [etl.block.height] - processing data
2021-10-03 09:15:50 stdout 2021-10-03T09:15:50 [INFO]: [collector.height] - Block height data ready to process
2021-10-03 09:15:49 stdout 2021-10-03T09:15:49 [INFO]: [etl.block.height] - Sending data to prometheus pushgateway
2021-10-03 09:15:49 stdout 2021-10-03T09:15:49 [INFO]: [etl.block.height] - processing data
2021-10-03 09:15:49 stdout 2021-10-03T09:15:49 [INFO]: [collector.height] - getting block height data
2021-10-03 09:14:49 stdout 2021-10-03T09:14:49 [INFO]: [etl.block.height] - Sending data to prometheus pushgateway
2021-10-03 09:14:49 stdout 2021-10-03T09:14:49 [INFO]: [etl.block.height] - processing data
2021-10-03 09:13:50 stdout 2021-10-03T09:13:50 [INFO]: [collector.height] - Block height data ready to process
2021-10-03 09:13:49 stdout 2021-10-03T09:13:49 [INFO]: [etl.block.height] - Sending data to prometheus pushgateway
2021-10-03 09:13:49 stdout 2021-10-03T09:13:49 [INFO]: [collector.height] - getting block height data
2021-10-03 09:13:49 stdout 2021-10-03T09:13:49 [INFO]: [etl.block.height] - processing data
2021-10-03 09:12:49 stdout 2021-10-03T09:12:49 [INFO]: [etl.block.height] - Sending data to prometheus pushgateway
2021-10-03 09:12:49 stdout 2021-10-03T09:12:49 [INFO]: [etl.block.height] - processing data
2021-10-03 09:11:50 stdout 2021-10-03T09:11:50 [INFO]: [collector.height] - Block height data ready to process
2021-10-03 09:11:49 stdout 2021-10-03T09:11:49 [INFO]: [etl.block.height] - Sending data to prometheus pushgateway
2021-10-03 09:11:49 stdout 2021-10-03T09:11:49 [INFO]: [etl.block.height] - processing data
2021-10-03 09:11:49 stdout 2021-10-03T09:11:49 [INFO]: [collector.height] - getting block height data
2021-10-03 09:10:49 stdout 2021-10-03T09:10:49 [INFO]: [etl.block.height] - Sending data to prometheus pushgateway
2021-10-03 09:10:49 stdout 2021-10-03T09:10:49 [INFO]: [etl.block.height] - processing data
2021-10-03 09:09:50 stdout 2021-10-03T09:09:50 [INFO]: [collector.height] - Block height data ready to process
2021-10-03 09:09:49 stdout 2021-10-03T09:09:49 [INFO]: [etl.block.height] - Sending data to prometheus pushgateway
2021-10-03 09:09:49 stdout 2021-10-03T09:09:49 [INFO]: [etl.block.height] - processing data
2021-10-03 09:09:49 stdout 2021-10-03T09:09:49 [INFO]: [collector.height] - getting block height data
2021-10-03 09:08:49 stdout 2021-10-03T09:08:49 [INFO]: [etl.block.height] - Sending data to prometheus pushgateway
2021-10-03 09:08:49 stdout 2021-10-03T09:08:49 [INFO]: [etl.block.height] - processing data
2021-10-03 09:07:50 stdout 2021-10-03T09:07:50 [INFO]: [collector.height] - Block height data ready to process
2021-10-03 09:07:49 stdout 2021-10-03T09:07:49 [INFO]: [etl.block.height] - Sending data to prometheus pushgateway
2021-10-03 09:07:49 stdout 2021-10-03T09:07:49 [INFO]: [system.cleanup] - starting data cleanup service
2021-10-03 09:07:49 stdout 2021-10-03T09:07:49 [INFO]: [collector.height] - getting block height data
2021-10-03 09:07:49 stdout 2021-10-03T09:07:49 [INFO]: [etl.block.height] - processing data
2021-10-03 09:06:49 stdout 2021-10-03T09:06:49 [INFO]: [main] - setting initialize to false
2021-10-03 09:06:40 stdout 2021-10-03T09:06:40 [INFO]: [collector.height] - Block height data ready to process
2021-10-03 09:06:39 stdout 2021-10-03T09:06:39 [INFO]: [collector.height] - getting block height data
2021-10-03 09:06:39 stdout 2021-10-03T09:06:39 [INFO]: [main] - allowing collections to finish before processesing data
2021-10-03 09:06:39 stdout 2021-10-03T09:06:39 [INFO]: [main] - removing stale locks
2021-10-03 09:06:39 stdout 2021-10-03T09:06:39 [INFO]: [main] - initializing hnt monitor
2021-10-03 09:06:39 stdout 2021-10-03T09:06:39 [INFO]: [startup.config] - Configuring [trace]: false
2021-10-03 09:06:39 stdout 2021-10-03T09:06:39 [INFO]: [startup.config] - Configuring [sensecap_serial_numbers]:
2021-10-03 09:06:39 stdout 2021-10-03T09:06:39 [INFO]: [startup.config] - Configuring [sensecap_monitor]: false
2021-10-03 09:06:39 stdout 2021-10-03T09:06:39 [INFO]: [startup.config] - Configuring [sensecap_api_key]:
2021-10-03 09:06:39 stdout 2021-10-03T09:06:39 [INFO]: [startup.config] - Configuring [prometheus_pg_host]: http://localhost:9091
2021-10-03 09:06:39 stdout 2021-10-03T09:06:39 [INFO]: [startup.config] - Configuring [project]: hnt_miner
2021-10-03 09:06:39 stdout 2021-10-03T09:06:39 [INFO]: [startup.config] - Configuring [nebra_monitor]: false
2021-10-03 09:06:39 stdout 2021-10-03T09:06:39 [INFO]: [startup.config] - Configuring [nebra_ips]:
2021-10-03 09:06:39 stdout 2021-10-03T09:06:39 [INFO]: [startup.config] - Configuring [longap_monitor]: false
2021-10-03 09:06:39 stdout 2021-10-03T09:06:39 [INFO]: [startup.config] - Configuring [longap_addresses]:
2021-10-03 09:06:39 stdout 2021-10-03T09:06:39 [INFO]: [startup.config] - Configuring [logpath]: /dev/
2021-10-03 09:06:39 stdout 2021-10-03T09:06:39 [INFO]: [startup.config] - Configuring [logfile]: stdout
2021-10-03 09:06:39 stdout 2021-10-03T09:06:39 [INFO]: [startup.config] - Configuring [hotspot_url]: https://api.helium.io/v1/hotspots
2021-10-03 09:06:39 stdout 2021-10-03T09:06:39 [INFO]: [startup.config] - Configuring [hotspot_monitor]: false
2021-10-03 09:06:39 stdout 2021-10-03T09:06:39 [INFO]: [startup.config] - Configuring [hotspot_addresses]:
2021-10-03 09:06:39 stdout 2021-10-03T09:06:39 [INFO]: [startup.config] - Configuring [helium_monitor]: true
2021-10-03 09:06:39 stdout 2021-10-03T09:06:39 [INFO]: [startup.config] - Configuring [debug]: false
2021-10-03 09:06:39 stdout 2021-10-03T09:06:39 [INFO]: [startup.config] - Configuring [bobcat_monitor]: false
2021-10-03 09:06:39 stdout 2021-10-03T09:06:39 [INFO]: [startup.config] - Configuring [bobcat_ips]:
2021-10-03 09:06:39 stdout 2021-10-03T09:06:39 [INFO]: [startup.config] - Configuring [blocks_url]: https://api.helium.io/v1/blocks
2021-10-03 09:04:10 stdout 2021-10-03T09:04:10 [INFO]: [collector.height] - Block height data ready to process
2021-10-03 09:04:10 stdout 2021-10-03T09:04:10 [INFO]: [etl.block.height] - Sending data to prometheus pushgateway
2021-10-03 09:04:10 stdout 2021-10-03T09:04:10 [INFO]: [system.cleanup] - starting data cleanup service
2021-10-03 09:04:10 stdout 2021-10-03T09:04:10 [INFO]: [etl.block.height] - processing data
2021-10-03 09:04:10 stdout 2021-10-03T09:04:10 [INFO]: [collector.height] - getting block height data
2021-10-03 09:03:10 stdout 2021-10-03T09:03:10 [INFO]: [main] - setting initialize to false
2021-10-03 09:03:01 stdout 2021-10-03T09:03:01 [INFO]: [collector.height] - Block height data ready to process
2021-10-03 09:03:00 stdout 2021-10-03T09:03:00 [INFO]: [collector.height] - getting block height data
2021-10-03 09:03:00 stdout 2021-10-03T09:03:00 [INFO]: [main] - allowing collections to finish before processesing data
2021-10-03 09:03:00 stdout 2021-10-03T09:03:00 [INFO]: [main] - removing stale locks
2021-10-03 09:03:00 stdout 2021-10-03T09:03:00 [INFO]: [main] - initializing hnt monitor
2021-10-03 09:03:00 stdout 2021-10-03T09:03:00 [INFO]: [startup.config] - Configuring [trace]: false
2021-10-03 09:03:00 stdout 2021-10-03T09:03:00 [INFO]: [startup.config] - Configuring [sensecap_serial_numbers]:
2021-10-03 09:03:00 stdout 2021-10-03T09:03:00 [INFO]: [startup.config] - Configuring [sensecap_monitor]: false
2021-10-03 09:03:00 stdout 2021-10-03T09:03:00 [INFO]: [startup.config] - Configuring [sensecap_api_key]:
2021-10-03 09:03:00 stdout 2021-10-03T09:03:00 [INFO]: [startup.config] - Configuring [prometheus_pg_host]: http://localhost:9091
2021-10-03 09:03:00 stdout 2021-10-03T09:03:00 [INFO]: [startup.config] - Configuring [project]: hnt_miner
2021-10-03 09:03:00 stdout 2021-10-03T09:03:00 [INFO]: [startup.config] - Configuring [nebra_monitor]: false
2021-10-03 09:03:00 stdout 2021-10-03T09:03:00 [INFO]: [startup.config] - Configuring [nebra_ips]:
2021-10-03 09:03:00 stdout 2021-10-03T09:03:00 [INFO]: [startup.config] - Configuring [longap_monitor]: false
2021-10-03 09:03:00 stdout 2021-10-03T09:03:00 [INFO]: [startup.config] - Configuring [longap_addresses]:
2021-10-03 09:03:00 stdout 2021-10-03T09:03:00 [INFO]: [startup.config] - Configuring [logpath]: /dev/
2021-10-03 09:03:00 stdout 2021-10-03T09:03:00 [INFO]: [startup.config] - Configuring [logfile]: stdout
2021-10-03 09:03:00 stdout 2021-10-03T09:03:00 [INFO]: [startup.config] - Configuring [hotspot_url]: https://api.helium.io/v1/hotspots
2021-10-03 09:03:00 stdout 2021-10-03T09:03:00 [INFO]: [startup.config] - Configuring [hotspot_monitor]: false
2021-10-03 09:03:00 stdout 2021-10-03T09:03:00 [INFO]: [startup.config] - Configuring [hotspot_addresses]:
2021-10-03 09:03:00 stdout 2021-10-03T09:03:00 [INFO]: [startup.config] - Configuring [helium_monitor]: true
2021-10-03 09:03:00 stdout 2021-10-03T09:03:00 [INFO]: [startup.config] - Configuring [debug]: false
2021-10-03 09:03:00 stdout 2021-10-03T09:03:00 [INFO]: [startup.config] - Configuring [bobcat_monitor]: false
2021-10-03 09:03:00 stdout 2021-10-03T09:03:00 [INFO]: [startup.config] - Configuring [bobcat_ips]:
2021-10-03 09:03:00 stdout 2021-10-03T09:03:00 [INFO]: [startup.config] - Configuring [blocks_url]: https://api.helium.io/v1/blocks

SenseCAP Block Height is incorrect

Block height for Sensecap seems to show the blockchain height, not the synced height of a hotspot.

In the API Docs (https://status-api-doc.sensecapmx.cloud/) in the device detail request there's a separate field for Block height of device (called 'height') and another for the height of the blockchain (called 'totalHeight'), looks like the monitoring might be reading the latter field.

Improve logging

Create a log function so it is easier to send logged data. Right now each service has to tailor the full log message multiple times.

invalid IPv4 address

Successfully tagged hnt_monitor:latest
Creating grafana                ... error
Creating prometheus ... 
Creating prometheus_pushgateway ... 

Creating prometheus_pushgateway ... error
Creating prometheus             ... error
ERROR: for prometheus_pushgateway  Cannot create container for service prometheus_pushgateway: invalid IPv4 address: 10.30.0.04

ERROR: for prometheus  Cannot create container for service prometheus: invalid IPv4 address: 10.30.0.03

ERROR: for grafana  Cannot create container for service grafana: invalid IPv4 address: 10.30.0.02

ERROR: for prometheus_pushgateway  Cannot create container for service prometheus_pushgateway: invalid IPv4 address: 10.30.0.04

ERROR: for prometheus  Cannot create container for service prometheus: invalid IPv4 address: 10.30.0.03

Fix: remove the zero from the last ips like 04 -> 4 and docker-compose -f hnt_monitor.yml up -d --build

Pls fix in next version.

invalid IPv4 address

i saw there is a closed issue with the same error:

Step 9/9 : ENTRYPOINT ["./entrypoint"]
 ---> Using cache
 ---> e05d02cdda97
Successfully built e05d02cdda97
Successfully tagged hnt_monitor:latest
Recreating 992ae87577fa_prometheus ...
Recreating 6c8e55c4bf64_grafana                ... error
Recreating 5b1c29c87d20_prometheus_pushgateway ...

Recreating 992ae87577fa_prometheus             ... error

ERROR: for 5b1c29c87d20_prometheus_pushgateway  Cannot create container for service prometheus_pushgateway: invalid IPv4 address: 10.30.0.04

ERROR: for 992ae87577fa_prometheus  Cannot create container for service prometheus: invalid IPv4 address: 10.30.0.03

ERROR: for grafana  Cannot create container for service grafana: invalid IPv4 address: 10.30.0.02

ERROR: for prometheus_pushgateway  Cannot create container for service prometheus_pushgateway: invalid IPv4 address: 10.30.0.04

ERROR: for prometheus  Cannot create container for service prometheus: invalid IPv4 address: 10.30.0.03
ERROR: Encountered errors while bringing up the project.
root@store:/home/steam/hnt_monitor-7.10.0#

in the closed issue someone say it caused by version of docker but i use the latest:

root@store:/home/steam/hnt_monitor-7.10.0# docker --version
Docker version 20.10.16, build aa7e414

Beacon and challenges reporting back zero

Hi,
I don't have access to my miners because they are in a different location. But I would like to grab some data via the API. I came across your project and it seems awesome. I was able to set it up in docker and I define my two hotspots but the beacon and challenges are reporting like zero. Are those required for local IP or API?

So my witnesses are reporting back zero. Kind of odd.

I basically just want to use your project to scrape API data and show it in grafana.

Screenshot_20220710-155724_Chrome

Extend SenseCAP API retrieved information

Great project! Already using it for some days. :-)

Would be nice if all the SenseCAP API provided information would be pulled.
E.g. FW version, Fan-Status, ...

And if we could have a helium wallet overview, e.g. total balance of wallet, daily income

Add retry logic to reward collection

Possibly others might need this same treatment. Currently when the api does not respond, it produces 0's in the UI. We should retry the api query before sending null values

Other Miners Appearing

I have 4 hotspot addresses in HNT_HOTSPOT_ADDRESSES. 3 Rak MNTD and 1 Sensecap. I also have the Sensecap API setup. This morning I went to check my dashboard and now see two additional miners in my metrics: shambolic-walnut-chimpanzee and zealous-marigold-mouse. This is day 5 with the stack running and the first time I've seen them.

I checked these out on Helium Explorer just to cross references their addresses to my config and verify their wallet addresses weren't similar.

hnt_miner_reward_earned

This is not related to the grafana but the prometheus unless the API is giving back false data.

First of:

hnt_miner_reward_earned_1d is correct

however the 7d and 30d showing the exact same value which would be only true if I would just setup the miner not long ago.

How are these windows working then? Like my current daily reward is 0.06 HNT, according to the explorer my 7d is 0.5 HNT and the 30D is 1.8 HNT whilst with your metrics I get:

hnt_miner_reward_earned_1d 0.06

hnt_miner_reward_earned_7d 0.06

hnt_miner_reward_earned_30d 0.06

Now things gets more odd with the hnt_miner_reward_1d 7d 30d, I don't know what this supposed to display but I get 5 for all, even my overall HNT earnings are not 5.

Add pisces

Would be nice to add pisces also. Did not research if they have a public api.

Add an initial backfill

When first launching the services they should backfill 14 days worth of data. This should only happen on initial setups that have no existing data

Would be nice to store data locally and query the API less

We should create a database for this and store the data locally. That would allow us to not tax the API as often, and also return small data sets of only 15 minutes

Thinking about a backend like cassandra with modification to the scripts. Then we can post the same data while also not hitting the API as hard

Miner block height

How do you get the block height and cpu core temperatures per miner.

The block height only available as a HNT metric coming from their system not the nodes. CPU is not available at all
Mine is nebra I have added this to the hnt_monitor.yml


    environment:
      DO_NOT_REMOVE: "setup"
      HNT_HOTSPOT_MONITOR: "true"
      HNT_NEBRA_MONITOR: "true"

Also what is the point of having the internal LAN ips defined for Nebras?

Need help with debugging

Getting the following error after installing the stack.

2021-12-01T02:52:34 [INFO] [collector.info] [local] - getting hotspot info data for [local (115....k21)]
2021-12-01T02:52:34 [INFO] [collector.rewards] [local] - getting hotspot rewards data for [local (115....k21)]
2021-12-01T02:52:34 [INFO] [collector.bobcat.miner] [local] - getting bobcat miner data for [local (192.168.88.67)]
2021-12-01T02:52:34 [WARN] [collector.bobcat.status] [local] - bad response from the api gateway while retrieving status data for 192.168.88.67. Retrying in 5 seconds...
2021-12-01T02:52:50 [WARN] [collector.rewards] [local] - bad response from the api gateway while retrieving rewards data for 115....k21. Retrying in 5 seconds...

The bobcat miner dashboards have data but anything with the helium network is not being updated because of the api gateway error. I truncated the key but it is the full key of course in the setup. Unable to find any help on this on the web. I'm sure its something simple.

System is ubuntu 18.04. thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.