Basic witness tasks' health check - python script

in witness-category •  11 months ago


Today I got notified by @pfunk and @clayop (thanks!) that my pricefeed had not been updated in a while. This was the second time in a short period that the pricefeed update script had crashed and it had slipped my mind. Not good.

Learning more Python I wanted to give it a shot to create a basic monitor script which notifies me whenever I had not updated my pricefeed in a while (configurable - and therefore most probably there must be some error).

Additionally as @gtg recently also noticed, quite some public seednodes had been down and it seemed some witnesses had not noticed that, so I also added basic seednode timeout check too, by utilising Telnet lib inside python.

By using the Telegram API the basic monitor script notifies whenever:

  1. Your pricefeed has not been updated in a X period of hours
  2. Your public seednode is unresponsive / timeout or another error

Usage of the script requires a Bot on Telegram (read here) and @xeroc's piston-steem library for python.

Setup is pretty straightforward:

  1. Copy witnesshealthcheck.py over to a server with interwebs and Piston.steem
  2. Fill out the telegram_token and telegram_id variables as well as your witness and seed_node info.
  3. chmod +x witnesshealthcheck.py
  4. Test the script for example with a very low value for pricefeed_updatetreshold (it should notify immediately if you put it to 0)
  5. Put the script inside a regular called (e.g. every 2/4 hours) cronjob.

Checkout the 'Witness Health Check' script on Github »

* image source: http://medicalfuturist.com

  • Open for pull requests!
  • Any additional vital signs this witness script should check for? Leave your comments!
Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  trending
·

I never left! I'm here every day! But I don't write every day :)

·
·

How would you go about improving steemtools.com ? I know my friend has a project in there that has zero work done and is barely an incomplete concept that was completely dropped. Esteem Power. There are too many right now that it might be an idea to start categorizing them. About 12 of theme should not be there and make Steem look bad.

·
·
·

Thanks for your heads up @transisto. In SteemTools I added an option a month or so back where you can sort by 'ranking'. (Click the trofee icon to get this done). If you send me a list on Steemit.chat dm @roelandp I will take a look into your findings of incomplete apps! thx.

·
·
·
·

You should really include a way to contact you on the page Steemtools.com Having to find a random post you did and reply to it is not very efficient and awkward. I tried to find your name in steemit.chat but nothing. I would like to request to take off "Esteem Power" and consider removing http://steemwiki.com/ I've tried contacting the owner, I've tried creating an account, ( never got the confirmation email) The wiki is very incomplete and has very outdated information. How can I contact you next time I find problematic "Tools" ?

·
·
·
·
·

Hi @transisto! thanks! I am available via https://steemit.chat/direct/roelandp ! This is what I also said in my previous reply (if you send me a list on Steemit.chat dm @roelandp).

Thank you for letting me know about the two findings. Its with help like yours that this list can keep being updated. I will consider adding a "GraveYard" option where you can find "dead" tools.

Very nice and useful tool. Thanks for sharing.

This is great! thanks for creating it @roelandp

Hi there. I was wondering if you made an error...I read @surfermarley's recent article pertaining to paypal, and below in the comment section was a reply by @sigmajin that you downvoted... It's actually an extremely helpful comment/tip, as I've also been having my own issues with paypal and looking into alternatives. If you would take a look and remove the downvote or explain the reason, I'd greatly appreciate it.
You were the first witness I voted for once I learned about them on this platform, I know you do a great deal for steemit.

·

Hi @dreemit , pls can u link to the comment and i will look into it. I might have made a mistake or something strange is happening

·
·

Thank you for resolving this, I appreciate everything you do!

Very good post, I like you very much, I follow you

So interesting. Anyone here not a bot and wants to follow me. My reputation score really sux.