LOGS_FOLDER – checks folder with nodes’ log files.CONFIGS_FOLDER – checks folder with nodes’ configuration files;WATCHDOG_LOG – was used for restarts calculation;EMAIL – is used for profile maintaining on the statistic’s server.

* WATCHDOG_LOG - you may leave unfilled, it will be deprecated soon.

Save the configuration file.

Now we need to set up an automatic data collection and sending it to the statistic server. Add following commands to the crontab file:

The variable PATH probably already has some parameters, but we should add the path to the node environment interpreter. You can precise a path to the interpreter with command:

which node

You should receive an answer as follows:

~/.nvm/versions/node/v6.11.3/bin/node

You should add this path to the PATH variable.
Please note you should change this path every time after the node updates, because name of node folder will be changed with a new node’s version number.

Script update

To update the script, you should move to the script’s home folder and run command:

git pull

The utility git downloads the latest version of the health script. All changes will run immediately. There is no need to setup any additional components or make any changes in config.cfg. Restarting the storjshare-daemon is not necessary too.

How to run the script manually

The health script runs in two different modes:
The first mode is showing statistics without data sending to the statistic server:

bash health.sh –cli

The second mode is used for sending data to the statistic server:

bash health.sh –api

Script diagnostic

In case the script does not send date to the statistic server, you should change an old string in the crontab file:

How to switch to the automatic update

First version of the health script were set up with wget command and changing an old script’s version with a new one. All of variables were inside the script and needed to be changed manually every update procedure. Nowadays these obstacles are successfully overcome.

To change a very old script with a new version you should set up it by using git and make changes in the config.cfg as described above.

If you already have a version with config.cfg file, you just need set up a new version with git and change a new config.cfg with the old version.

Take into account git makes a new folder Storj-Utils and all new files will be in this folder and don’t forget to change the path to the script in the crontab.