Author Topic: (Witness) Tool: Server Stats to Telegram  (Read 571 times)

0 Members and 1 Guest are viewing this topic.

Offline roelandp

  • Full Member
  • ***
  • Posts: 111
  • Witness, dad, kitesurfer, event organiser
    • View Profile
    • RoelandP.nl
  • BitShares: roelandp
  • GitHub: roelandp
(Witness) Tool: Server Stats to Telegram
« on: May 08, 2017, 12:02:36 am »
Here is a little tool I made to get an automated report of server Key Performance Indicators at my morning coffee, delivered via Telegram. This can come in useful for witnesses to have a finger on their server's performance.

What this script does is checking and reporting:
* Disk Space (free / used)
* CPU usage per core
* Ram space (free / used)

Collects it and sends it as a Telegram message. Simply configure a cronjob to get the report as often as you like.

Depends on psutil, requests an os packages for Python3.

Preview


Check out the script on my github:
https://github.com/roelandp/server-stats-to-telegram

Offline Thom

Re: (Witness) Tool: Server Stats to Telegram
« Reply #1 on: May 08, 2017, 04:58:16 pm »
Here is a little tool I made to get an automated report of server Key Performance Indicators at my morning coffee, delivered via Telegram. This can come in useful for witnesses to have a finger on their server's performance.

What this script does is checking and reporting:
* Disk Space (free / used)
* CPU usage per core
* Ram space (free / used)

Collects it and sends it as a Telegram message. Simply configure a cronjob to get the report as often as you like.

Depends on psutil, requests an os packages for Python3.

Preview


Check out the script on my github:
https://github.com/roelandp/server-stats-to-telegram

Awesome [member=43607]roelandp[/member]! Thank you for being fully engaged and helping to improve the BitShares ecosystem. There was a time when most Witnesses were similarly engaged, but it's been so long ago since we've seen it. I am nearing a point where I can begin to get serious about improving my python skills, which I will apply to improving bts_tools. Working on infrastructure items like a VPN and secure email server atm. Thank you for all you do sir!

FYI - this is a very nice and useful addition. Aside from the Telegram angle, bts_tools also reports on these stats, and alerts a Witness when they miss blocks, get voted out and a number of other alert items it tracks. If you want it will send you an email alert which you could see on your smartphone.

My smartphone is quite dated. I am thinking about getting a new one and if I do I will get one with a screen big enough to allow me to open a terminal window and interact with my nodes, for example to switch signing keys should the Witness node die or otherwise become unreliable.
Injustice anywhere is a threat to justice everywhere - MLK |  Verbaltech2 Witness Reports: https://bitsharestalk.org/index.php/topic,23902.0.html