Update README and health check setup-scripts

This commit is contained in:
Marcin Jachymiak 2020-03-09 16:01:41 -04:00
parent 285d915602
commit 1349440251
2 changed files with 25 additions and 2 deletions

View File

@ -115,3 +115,20 @@ You can check that with `node -v` and `yarn -v` commands respectively.
- run `yarn build` to build the client package
Client package will be outputted to `/public` and nginx configuration will pick it up automatically.
## Health Check Scripts.
There are 2 optional health check scripts that can be setup using
`setup-health-check-scripts.sh`. That command will install the necesary Python
dependencies and setup 2 cronjobs for each script: one for a downloading `siad`
and for an uploading `siad` service.
To use the scripts you must setup a Discord bot and provide a bot token. The bot
scripts take in 1 or more arguments, the first always being the path to an
`.env` file.
`funds-checker` checks that the wallet balance and allowance settings are
sufficient for portal usage.
`log-checker` checks if there are any critical warnings in the journal for the
running services.

View File

@ -7,8 +7,14 @@ sudo apt-get -y install python3-pip
pip3 install discord.py
pip3 install python-dotenv
downloadCheck="0 0,8,16 * * * ~/skynet-webportal/setup-scripts/health-checker.py ~/.sia/sia.env"
uploadCheck="0 0,8,16 * * * ~/skynet-webportal/setup-scripts/health-checker.py ~/.sia/sia-upload.env"
downloadCheck="0 0,8,16 * * * ~/skynet-webportal/setup-scripts/funds-checker.py ~/.sia/sia.env"
uploadCheck="0 0,8,16 * * * ~/skynet-webportal/setup-scripts/funds-checker.py ~/.sia/sia-upload.env"
logCheck1="0 * * * * ~/skynet-webportal/setup-scripts/log-checker.py ~/.sia/sia.env"
logCheck2="0 * * * * ~/skynet-webportal/setup-scripts/log-checker.py ~/.sia/sia-upload.env siad-upload"
(crontab -u user -l; echo "$downloadCheck" ) | crontab -u user -
(crontab -u user -l; echo "$uploadCheck" ) | crontab -u user -
(crontab -u user -l; echo "$logCheck1" ) | crontab -u user -
(crontab -u user -l; echo "$logCheck2" ) | crontab -u user -