From 1349440251b94084e02ee876f659f3294401b814 Mon Sep 17 00:00:00 2001 From: Marcin Jachymiak Date: Mon, 9 Mar 2020 16:01:41 -0400 Subject: [PATCH] Update README and health check setup-scripts --- setup-scripts/README.md | 17 +++++++++++++++++ setup-scripts/setup-health-check-scripts.sh | 10 ++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/setup-scripts/README.md b/setup-scripts/README.md index f507cc34..c43f8dc0 100644 --- a/setup-scripts/README.md +++ b/setup-scripts/README.md @@ -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. diff --git a/setup-scripts/setup-health-check-scripts.sh b/setup-scripts/setup-health-check-scripts.sh index aae7063b..f347b16e 100755 --- a/setup-scripts/setup-health-check-scripts.sh +++ b/setup-scripts/setup-health-check-scripts.sh @@ -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 -