Basic witness tasks' health check - python script by roelandp

View this thread on steempeak.com
· @roelandp · (edited)
$42.50
Basic witness tasks' health check - python script
http://medicalfuturist.com/wp-content/uploads/2016/08/da_Vinci_S_HD_System.jpg
<b>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.</b> 

Learning more Python I wanted to give it a shot to create a <b><a href="https://github.com/roelandp/witnesshealthcheck">basic monitor script</a></b> 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 <a href="https://steemit.com/witness-category/@gtg/call-for-steem-seed-nodes">recently also noticed</a>, 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.

<b>By using the Telegram API the <b><a href="https://github.com/roelandp/witnesshealthcheck">basic monitor script</a></b> notifies whenever:</b>
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 <a href="https://github.com/roelandp/witnesshealthcheck">script</a> requires a Bot on Telegram (<a href="https://www.forsomedefinition.com/automation/creating-telegram-bot-notifications/">read here</a>) and @xeroc's <a href="http://piston.rocks">piston-steem library</a> for python. 

<h3>Setup is pretty straightforward:</h3> 
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.

<h2><a href="https://github.com/roelandp/witnesshealthcheck">Checkout the 'Witness Health Check' script on Github &raquo;</a></h2>

<sup>* image source: http://medicalfuturist.com</sup>

- Open for pull requests!
- Any additional vital signs this witness script should check for? Leave your comments!
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 266 others
properties (23)
post_id1,772,244
authorroelandp
permlinkbasic-witness-tasks-health-check-python-script
categorywitness-category
json_metadata"{"format": "markdown", "links": ["https://github.com/roelandp/witnesshealthcheck", "https://steemit.com/witness-category/@gtg/call-for-steem-seed-nodes", "https://www.forsomedefinition.com/automation/creating-telegram-bot-notifications/", "http://piston.rocks", "http://medicalfuturist.com"], "app": "steemit/0.1", "tags": ["witness-category", "tools", "python"], "users": ["pfunk", "clayop", "gtg", "xeroc"], "image": ["http://medicalfuturist.com/wp-content/uploads/2016/08/da_Vinci_S_HD_System.jpg"]}"
created2017-01-17 00:01:42
last_update2017-01-17 00:28:21
depth0
children15
net_rshares80,486,257,981,120
last_payout2017-02-17 02:07:51
cashout_time1969-12-31 23:59:59
total_payout_value39.626 SBD
curator_payout_value2.876 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length2,269
author_reputation326,922,223,812,714
root_title"Basic witness tasks' health check - python script"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (330)
@thecryptofiend ·
Very ingenious!
👍  
properties (23)
post_id1,772,257
authorthecryptofiend
permlinkre-roelandp-basic-witness-tasks-health-check-python-script-20170117t000338753z
categorywitness-category
json_metadata"{"app": "steemit/0.1", "tags": ["witness-category"]}"
created2017-01-17 00:03:42
last_update2017-01-17 00:03:42
depth1
children0
net_rshares2,163,734,363
last_payout2017-02-17 02:07:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length15
author_reputation323,593,656,929,629
root_title"Basic witness tasks' health check - python script"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (1)
@kingscrown ·
so @roelandp is back!
👍  
properties (23)
post_id1,772,317
authorkingscrown
permlinkre-roelandp-basic-witness-tasks-health-check-python-script-20170117t001609478z
categorywitness-category
json_metadata"{"app": "steemit/0.1", "users": ["roelandp"], "tags": ["witness-category"]}"
created2017-01-17 00:16:09
last_update2017-01-17 00:16:09
depth1
children5
net_rshares2,163,734,363
last_payout2017-02-17 02:07:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length21
author_reputation1,990,164,104,714,661
root_title"Basic witness tasks' health check - python script"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (1)
@roelandp ·
I never left! I'm here every day! But I don't write every day :)
👍  , , ,
properties (23)
post_id1,772,339
authorroelandp
permlinkre-kingscrown-re-roelandp-basic-witness-tasks-health-check-python-script-20170117t002258615z
categorywitness-category
json_metadata"{"app": "steemit/0.1", "tags": ["witness-category"]}"
created2017-01-17 00:23:00
last_update2017-01-17 00:23:00
depth2
children4
net_rshares621,768,749,314
last_payout2017-02-17 02:07:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length64
author_reputation326,922,223,812,714
root_title"Basic witness tasks' health check - python script"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (4)
@transisto ·
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.
properties (22)
post_id1,839,484
authortransisto
permlinkre-roelandp-re-kingscrown-re-roelandp-basic-witness-tasks-health-check-python-script-20170126t091959545z
categorywitness-category
json_metadata"{"app": "steemit/0.1", "tags": ["witness-category"]}"
created2017-01-26 09:22:18
last_update2017-01-26 09:22:18
depth3
children3
net_rshares0
last_payout2017-02-17 02:07:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length342
author_reputation331,131,121,482,590
root_title"Basic witness tasks' health check - python script"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@bitcoinparadise ·
Very nice and useful tool. Thanks for sharing.
👍  
properties (23)
post_id1,773,827
authorbitcoinparadise
permlinkre-roelandp-basic-witness-tasks-health-check-python-script-20170117t052331939z
categorywitness-category
json_metadata"{"app": "steemit/0.1", "tags": ["witness-category"]}"
created2017-01-17 05:23:33
last_update2017-01-17 05:23:33
depth1
children0
net_rshares2,163,734,363
last_payout2017-02-17 02:07:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length46
author_reputation52,885,100,418,823
root_title"Basic witness tasks' health check - python script"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (1)
@chitty ·
This is great! thanks for creating it @roelandp
properties (22)
post_id1,778,428
authorchitty
permlinkre-roelandp-basic-witness-tasks-health-check-python-script-20170117t210143974z
categorywitness-category
json_metadata"{"app": "steemit/0.1", "users": ["roelandp"], "tags": ["witness-category"]}"
created2017-01-17 21:01:45
last_update2017-01-17 21:01:45
depth1
children0
net_rshares0
last_payout2017-02-17 02:07:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length47
author_reputation84,463,031,858,396
root_title"Basic witness tasks' health check - python script"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@dreemit ·
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.
properties (22)
post_id1,895,147
authordreemit
permlinkre-roelandp-basic-witness-tasks-health-check-python-script-20170203t133542167z
categorywitness-category
json_metadata"{"app": "steemit/0.1", "users": ["surfermarley", "sigmajin"], "tags": ["witness-category"]}"
created2017-02-03 13:35:45
last_update2017-02-03 13:35:45
depth1
children3
net_rshares0
last_payout2017-02-17 02:07:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length540
author_reputation165,111,672,942,758
root_title"Basic witness tasks' health check - python script"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@roelandp ·
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
👍  
properties (23)
post_id1,896,251
authorroelandp
permlinkre-dreemit-re-roelandp-basic-witness-tasks-health-check-python-script-20170203t164938640z
categorywitness-category
json_metadata"{"app": "steemit/0.1", "users": ["dreemit"], "tags": ["witness-category"]}"
created2017-02-03 16:49:39
last_update2017-02-03 16:49:39
depth2
children2
net_rshares483,309,801,844
last_payout2017-02-17 02:07:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length130
author_reputation326,922,223,812,714
root_title"Basic witness tasks' health check - python script"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (1)
@dreemit ·
[Here it is](https://steemit.com/cryptocurrency/@surfermarly/more-reasons-to-believe-in-decentralized-cryptocurrency-revealing-paypal-s-incredible-fund-retention-policy-for-business-clients#@dreemit/re-sigmajin-re-sigmajin-re-surfermarly-more-reasons-to-believe-in-decentralized-cryptocurrency-revealing-paypal-s-incredible-fund-retention-policy-for-business-clients-20170203t132530301z)
properties (22)
post_id1,896,300
authordreemit
permlinkre-roelandp-re-dreemit-re-roelandp-basic-witness-tasks-health-check-python-script-20170203t165926772z
categorywitness-category
json_metadata"{"app": "steemit/0.1", "links": ["https://steemit.com/cryptocurrency/@surfermarly/more-reasons-to-believe-in-decentralized-cryptocurrency-revealing-paypal-s-incredible-fund-retention-policy-for-business-clients#@dreemit/re-sigmajin-re-sigmajin-re-surfermarly-more-reasons-to-believe-in-decentralized-cryptocurrency-revealing-paypal-s-incredible-fund-retention-policy-for-business-clients-20170203t132530301z"], "tags": ["witness-category"]}"
created2017-02-03 16:59:27
last_update2017-02-03 16:59:27
depth3
children0
net_rshares0
last_payout2017-02-17 02:07:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length387
author_reputation165,111,672,942,758
root_title"Basic witness tasks' health check - python script"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@dreemit · (edited)
Thank you for resolving this, I appreciate everything you do!
properties (22)
post_id1,899,380
authordreemit
permlinkre-roelandp-re-dreemit-re-roelandp-basic-witness-tasks-health-check-python-script-20170204t034155872z
categorywitness-category
json_metadata"{"app": "steemit/0.1", "tags": ["witness-category"]}"
created2017-02-04 03:41:54
last_update2017-02-04 18:38:12
depth3
children0
net_rshares0
last_payout2017-02-17 02:07:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length61
author_reputation165,111,672,942,758
root_title"Basic witness tasks' health check - python script"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@alexmejia ·
Very good post, I like you very much, I follow you
properties (22)
post_id3,115,297
authoralexmejia
permlinkre-roelandp-basic-witness-tasks-health-check-python-script-20170527t160736131z
categorywitness-category
json_metadata"{"app": "steemit/0.1", "tags": ["witness-category"]}"
created2017-05-27 16:07:48
last_update2017-05-27 16:07:48
depth1
children0
net_rshares0
last_payout2017-06-03 16:07:48
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length50
author_reputation576,914,043,810
root_title"Basic witness tasks' health check - python script"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@urbansteemers ·
So interesting. Anyone here not a bot and wants to follow me. My reputation score really sux.
properties (22)
post_id14,667,452
authorurbansteemers
permlinkre-roelandp-basic-witness-tasks-health-check-python-script-20171007t000601777z
categorywitness-category
json_metadata"{"app": "steemit/0.1", "tags": ["witness-category"]}"
created2017-10-07 00:06:06
last_update2017-10-07 00:06:06
depth1
children0
net_rshares0
last_payout2017-10-14 00:06:06
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length93
author_reputation84,679,401,098
root_title"Basic witness tasks' health check - python script"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000