OT Node Check (otcheck)

This script checks all important components and settings OT Node needs to run properly.

otcheck

Component Description Default Settings
Docker Container Status The script checks if a container with specific name (default otnode) exists, is running and not paused. If so, it shows how long OT Node container is already up and running. OTNODE=otnode
OT Node Software Version It queries the node to get info about the running version. This running version is compared to the current version on Github (where all OT Node software of different stages can be found).
LOG Files outside/inside Docker This shows the size of the files inside container and the one file outside Docker. Values above 100 MB (default) are red. MAXLOG=100
Online Check via Remote API With the start of this script a remote procedure is called to check if your node is responding on the configured port (default 5278).
Manual Check via Web Browser With this URL you can test the connectivity of your node via your Web Browser. That's an alternative to Check via Remote API.
Local Storage used This shows how much of the overall storage space is used in percent. Values above 80% (default) are red. MAXUSED=80
RPC Server URL working For this part the script runs an OT Node API call which only delivers results if RPC Server (you most probably configured Infura) works properly.
Operational Wallet (ETH) This is a result of the API call mentioned above. Values below 0.045 (default) are red. MINETH=0.045
TRAC reserved to Offers Amount of token reversed/staked for still running jobs, or finished jobs but the payout didn't work for some reason. This is the same value also shown on OT Hub as Locked Tokens.
TRAC available for Offers This is the amount of TRAC currently available for new offers. Values below 100 (default) are red. It's calculated this way: Total Stake - Reserved - MinimalStake (1000). MINTRAC=100
Operating System Status This checks how many components should be upgraded and if Docker is part of it. It shows additional info if all is up-to-date but the system needs a restart.

If you want to set your own limits, create the file /root/scripts/otcheck.cfg with your settings like:

MAXLOG=50
MAXUSED=70
MINETH=0.1
MINTRAC=200

Code Transparency

To ensure transparency the source code of all my scripts is maintained on Github, the biggest open source hosting platform, which keeps track of every change in the code, visible for everybody. Hence Github is used as the source for any installation.

I encourage you to go through the source code to check what the script does. I tried my best to keep the code as readable as possible by using self-explaining variables and adding a lot of comments. Let me know if you have questions or suggestions to improve readability or the functionality itself.

Installation

If you followed the setup guide your server meets all requirements to run this script, just install it with this single command:

curl -s https://raw.githubusercontent.com/befranz/otcheck/master/install-otcheck|bash&&source $HOME/.profile

After successful installation you can run OT Node Check script by

otcheck

Any new version of the script on Github (which is shown when you run the script) can be downloaded by

otcheck update

The script otcheck doesn't change anything on your server, it only queries and shows available information on screen.

Installation Script Details

The installation script checks the requirements otcheck needs to run and does a few other steps:

  • Checks if user is root
  • Checks if operating system (OS) is Ubuntu or Debian
  • Installs packages jq (JSON tool) and bc (Basic Calculator) if not already on your server
  • Creates the folder scripts in the root HOME folder (/root/scripts)
  • Downloads current version of script otcheck from Github and saves it in /root/scripts
  • Adds /root/scripts to PATH environment variable, so you can call programs in this path only by their name (otcheck)

History

Date Commits on Github
2019-05-16 Added: Installation Script v.1.0
2019-05-14 Update v.1.8 - Added: Check of Storage used (MAXUSED), custom limit settings, can send email if run via cron
2019-04-24 Update v.1.7 - Added: Online Check via OT Hub, additional info on screen
2019-04-23 Update v.1.6 - Added: Houston Login Information, changed OTHub Link to Node
2019-04-13 Update v.1.5 - Added: Version Check and update feature via 'otcheck update'
2019-04-12 Update v.1.3 - Fixed: Possible calc error with decimal TRAC
Added: Etherscan link to Operational Wallet
2019-04-08 Update v.1.2 - Changed: Log path inside Docker changed with OT Node version 2.0.52
2019-04-07 Update v.1.1 - Fixed: Paused or stopped Docker container was shown as 'Container does not exist'
2019-04-04 Initial Release v.1.0

I spent already several hours to build and test this script. If you think it's helpful and you will use it on your server(s) on a regular basis, supporting me would be great and help to support you!