[TUTORIAL]Recurrent succes rate report(only for linux)

Hi!

this is based in this script an various other tools.

the objective is to have a periodical update about the succes rate of your node.

I’ve managed to make it work in linux and debian (raspbian),don’t know if can work in other linux systems.

tutorial:

1º you have to download this script in the linux system.

2º try to use it (for example “./successrate.sh storjv3” if your node is named storjv3)

3º create a folder to store the reports (I’ve used /Logs/node/)

4º try to store a report in the folder with the command ./successrate.sh storjv3 < /path/to/folder/log-"$(date)".txt (this will create a .txt with the info,and with the name of log-current-date)

5º if sucessful,then follow this tutorial to prepare your linux sistem with the hability to send emails.
(the tutorial is meant to use a gmail account,but you can adapt it easily to use another mail service)

6º install mail (sudo apt-get install mailutils)

7º use (sudo nano node_sender.sh) and then in the folder copy this

#!/bin/bash
sudo LC_ALL=C /path/to/your/file/successrate.sh name_of_your_node > /path/to/your/folder/logs-"(date)".txt sleep 10 name_variable=(cd /path/to/your/folder/ && ls -Art | head -n1)
sudo mail -s “mail subject” your@email.com < /path/to/your/folder/"$name_variable"

use ctrl+o+enter to save and then ctrl+x to exit file. then use the command (sudo chmod +x node_sender.sh)

8º probe to use ./node_sender.sh and after finished check your mailbox for the report.

9º If worked,we just need to set the recurrence.

Use the command (sudo crontab -e) and there following the explanation put any calls you need to the /path/to/your/file/node_sender.sh to set your recurrence .

for example,I’ve configured to make it daily at 10AM,that will be (0 10 * * * /path/to/your/file/node_sender.sh)

and with that you will receibe a recurrent report about yout node status.