Skip to content

Latest commit

 

History

History
219 lines (152 loc) · 8.15 KB

ReadMe.md

File metadata and controls

219 lines (152 loc) · 8.15 KB

Energi Core Node Monitor for energi-docker-compose

Dockerised Energi Core Node Monitor for the dockerised Energi Core Node.



Enable the Energi Core Node Monitor service

To enable Energi Core Node Monitor, compose.override.template.yaml has to be copied in the root directory and renamed to compose.override.yaml. Then nodemon/.env.template.env must be copied and renamed to .env and values should be provided for environment variables when a non-interactive setup is used (value for INTERACTIVE_SETUP is a negative boolean-like value). All the environment variables are described in the subsection below.

To setup Energi Core Node Monitor container, command ./helper setup monitor (or ./helper setup if Energi Core Node and Energi Core Node Monitor are set up together) must be executed from the root directory (where compose.yaml is located). Energi Core Node Monitor container will be automatically started afterwards.

docker compose is used in ./helper setup so sudo might be necessary.

After the Energi Core Node Monitor container is launched for the first time or it is recreated, a message about user and group changes will be sent.

A note on uptime value in informational messages. As originally nodemon.sh is intended to run on the same server as Energi Core Node, then uptime value is meant to be the uptime of Core. In energi-docker-compose this value is the uptime of the cron process in the Energi Core Node Monitor container as Core and Monitor run in separate Docker containers.

Environment variables

.env contains environment variables that are used to set up Energi Core Node Monitor in a non-interactive mode (INTERACTIVE_SETUP has a positive boolean-like value). All of them are optional and most of them are used only in the configuration run.

Boolean-like values

The following values are considered as positive boolean values (true, case insensitive):

  • y;
  • yes;
  • true;
  • 1.

Anything else (including empty value or omitted variable) is considered as false.

Environment variables explained

This section contains a short description for each of environment variables that are used to configure the dockerised Energi Core Node Monitor.

DISCORD_WEBHOOK_CHANGE

For non-interactive setup a positive boolean-like value indicates that the existing Discord webhooks should be replaced with the value of the following environment variables if the Energi Core Node Monitor has already been set up:

Discord webhook addresses

One webhook address can be used for all message types.

More detailed instructions on how to set up Discord to receive messages from the Energi Core Node Monitor are located in the official Energi Core Node Monitoring Tool guide (the section "Setup Discord").

DISCORD_WEBHOOK_ERROR

Discord webhook address for error messages.

DISCORD_WEBHOOK_INFORMATION

Discord webhook address for information messages.

DISCORD_WEBHOOK_SUCCESS

Discord webhook address for success messages.

DISCORD_WEBHOOK_WARNING

Discord webhook address for warning messages.

ECNM_CURRENCY

The currency to be used in messages about wallet balance.

If not set, USD will be used.

ECNM_INTERVAL

An interval between two subsequent Energi Core Node Monitor runs.
The following suffixes can be used to specify the desired time units:

  • s or no suffix for seconds;
  • m for minutes;
  • h for hours;
  • d for days.

When this environment variable is not defined or it's value is not specified, the default interval will be used: 10 minutes.

ECNM_SERVER_ALIAS

A server name to be used in messages.

The default value: container's hostname (something like 35199a65247e).

ECNM_SHOW_IP

A positive boolean-like value indicates that the Energi Core Node Monitor's IP address should be displayed in messages.

This value alone is quite pointless as it will display the Energi Core Node Monitor Docker container's internal IP address.

To display server's external IP address, the environment variable ECNM_SHOW_IP_EXTERNAL must be set to a positive boolean-like value.

ECNM_SHOW_IP_EXTERNAL

When ECNM_SHOW_IP, a positive boolean-like value indicates that the server's external IP address should be displayed in messages instead of container's internal IP.

INTERACTIVE_SETUP

A positive boolean-like value indicates that the Energi Core Node Monitor setup process will be interactive. This means that all the neccessary values in setup process will have to be entered manually.

For interactive setup all environment variables can be left without values.

The default value is yes.

MARKET_PRICE_IN_INFORMATION

When set to a positive boolean-like value, the current market price will be added to informational message.

The default value is no.

MESSAGE_TIME_ZONE

To display date in time in messages in the specified time zone.

If MESSAGE_TIME_ZONE is omitted or its value is empty, or if time zone name is misspelled, container's default time zone (UTC) will be used.

Available time zones are listed on:

NRG_AMOUNT_IN_CURRENCY

When set to a positive boolean-like value, NRG balance in success messages is displayed in the configured currency.

The default value is no.

TELEGRAM_BOT_TOKEN

Token for Telegram bot to send Energi Core Node Monitor messages to.

When a Telegram bot is used, at least one message has to be sent to it recently so the result array in the response of https://api.telegram.org/bot{Telegram bot token}/getUpdates (where {Telegram bot token} is the actual token) is not empty, otherwise the script will not be able to set up Telegram integration.

Detailed instructions on how to set up Telegram are in the official Energi Core Node Monitoring Tool guide (the section "Setup Telegram").

TELEGRAM_BOT_TOKEN_CHANGE

For interactive setup a positive boolean-like value indicates that the existing Telegram token must be replaced with the one that is assigned to TELEGRAM_BOT_TOKEN if the Energi Core Node Monitor has been already set up.