create account

Basic witness tasks' health check - python script by roelandp

View this thread on: hive.blogpeakd.comecency.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)
authorroelandp
permlinkbasic-witness-tasks-health-check-python-script
categorywitness-category
json_metadata{"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"],"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","format":"markdown"}
created2017-01-17 00:01:42
last_update2017-01-17 00:28:21
depth0
children15
last_payout2017-02-17 02:07:51
cashout_time1969-12-31 23:59:59
total_payout_value39.626 HBD
curator_payout_value2.876 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length2,269
author_reputation662,936,810,561,284
root_title"Basic witness tasks' health check - python script"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id2,265,591
net_rshares80,486,257,981,120
author_curate_reward""
vote details (330)
@alexmejia ·
Very good post, I like you very much, I follow you
properties (22)
authoralexmejia
permlinkre-roelandp-basic-witness-tasks-health-check-python-script-20170527t160736131z
categorywitness-category
json_metadata{"tags":["witness-category"],"app":"steemit/0.1"}
created2017-05-27 16:07:48
last_update2017-05-27 16:07:48
depth1
children0
last_payout2017-06-03 16:07:48
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length50
author_reputation577,502,079,196
root_title"Basic witness tasks' health check - python script"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id3,857,618
net_rshares0
@bitcoinparadise ·
Very nice and useful tool. Thanks for sharing.
👍  
properties (23)
authorbitcoinparadise
permlinkre-roelandp-basic-witness-tasks-health-check-python-script-20170117t052331939z
categorywitness-category
json_metadata{"tags":["witness-category"],"app":"steemit/0.1"}
created2017-01-17 05:23:33
last_update2017-01-17 05:23:33
depth1
children0
last_payout2017-02-17 02:07:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length46
author_reputation52,935,636,369,082
root_title"Basic witness tasks' health check - python script"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id2,267,589
net_rshares2,163,734,363
author_curate_reward""
vote details (1)
@chitty ·
This is great! thanks for creating it @roelandp
properties (22)
authorchitty
permlinkre-roelandp-basic-witness-tasks-health-check-python-script-20170117t210143974z
categorywitness-category
json_metadata{"tags":["witness-category"],"users":["roelandp"],"app":"steemit/0.1"}
created2017-01-17 21:01:45
last_update2017-01-17 21:01:45
depth1
children0
last_payout2017-02-17 02:07:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length47
author_reputation86,901,300,608,582
root_title"Basic witness tasks' health check - python script"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id2,273,315
net_rshares0
@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)
authordreemit
permlinkre-roelandp-basic-witness-tasks-health-check-python-script-20170203t133542167z
categorywitness-category
json_metadata{"tags":["witness-category"],"users":["surfermarley","sigmajin"],"app":"steemit/0.1"}
created2017-02-03 13:35:45
last_update2017-02-03 13:35:45
depth1
children3
last_payout2017-02-17 02:07:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length540
author_reputation236,076,679,369,400
root_title"Basic witness tasks' health check - python script"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id2,412,916
net_rshares0
@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)
authorroelandp
permlinkre-dreemit-re-roelandp-basic-witness-tasks-health-check-python-script-20170203t164938640z
categorywitness-category
json_metadata{"tags":["witness-category"],"users":["dreemit"],"app":"steemit/0.1"}
created2017-02-03 16:49:39
last_update2017-02-03 16:49:39
depth2
children2
last_payout2017-02-17 02:07:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length130
author_reputation662,936,810,561,284
root_title"Basic witness tasks' health check - python script"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id2,414,234
net_rshares483,309,801,844
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)
authordreemit
permlinkre-roelandp-re-dreemit-re-roelandp-basic-witness-tasks-health-check-python-script-20170203t165926772z
categorywitness-category
json_metadata{"tags":["witness-category"],"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"],"app":"steemit/0.1"}
created2017-02-03 16:59:27
last_update2017-02-03 16:59:27
depth3
children0
last_payout2017-02-17 02:07:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length387
author_reputation236,076,679,369,400
root_title"Basic witness tasks' health check - python script"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id2,414,296
net_rshares0
@dreemit · (edited)
Thank you for resolving this, I appreciate everything you do!
properties (22)
authordreemit
permlinkre-roelandp-re-dreemit-re-roelandp-basic-witness-tasks-health-check-python-script-20170204t034155872z
categorywitness-category
json_metadata{"tags":["witness-category"],"app":"steemit/0.1"}
created2017-02-04 03:41:54
last_update2017-02-04 18:38:12
depth3
children0
last_payout2017-02-17 02:07:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length61
author_reputation236,076,679,369,400
root_title"Basic witness tasks' health check - python script"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id2,418,123
net_rshares0
@kingscrown ·
so @roelandp is back!
👍  
properties (23)
authorkingscrown
permlinkre-roelandp-basic-witness-tasks-health-check-python-script-20170117t001609478z
categorywitness-category
json_metadata{"tags":["witness-category"],"users":["roelandp"],"app":"steemit/0.1"}
created2017-01-17 00:16:09
last_update2017-01-17 00:16:09
depth1
children5
last_payout2017-02-17 02:07:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length21
author_reputation2,114,793,545,830,142
root_title"Basic witness tasks' health check - python script"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id2,265,679
net_rshares2,163,734,363
author_curate_reward""
vote details (1)
@roelandp ·
I never left! I'm here every day! But I don't write every day :)
👍  , , ,
properties (23)
authorroelandp
permlinkre-kingscrown-re-roelandp-basic-witness-tasks-health-check-python-script-20170117t002258615z
categorywitness-category
json_metadata{"tags":["witness-category"],"app":"steemit/0.1"}
created2017-01-17 00:23:00
last_update2017-01-17 00:23:00
depth2
children4
last_payout2017-02-17 02:07:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length64
author_reputation662,936,810,561,284
root_title"Basic witness tasks' health check - python script"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id2,265,708
net_rshares621,768,749,314
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)
authortransisto
permlinkre-roelandp-re-kingscrown-re-roelandp-basic-witness-tasks-health-check-python-script-20170126t091959545z
categorywitness-category
json_metadata{"tags":["witness-category"],"app":"steemit/0.1"}
created2017-01-26 09:22:18
last_update2017-01-26 09:22:18
depth3
children3
last_payout2017-02-17 02:07:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length342
author_reputation330,357,940,720,833
root_title"Basic witness tasks' health check - python script"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id2,346,568
net_rshares0
@thecryptofiend ·
Very ingenious!
👍  
properties (23)
authorthecryptofiend
permlinkre-roelandp-basic-witness-tasks-health-check-python-script-20170117t000338753z
categorywitness-category
json_metadata{"tags":["witness-category"],"app":"steemit/0.1"}
created2017-01-17 00:03:42
last_update2017-01-17 00:03:42
depth1
children0
last_payout2017-02-17 02:07:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length15
author_reputation323,603,913,866,384
root_title"Basic witness tasks' health check - python script"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id2,265,608
net_rshares2,163,734,363
author_curate_reward""
vote details (1)
@urbansteemers ·
So interesting. Anyone here not a bot and wants to follow me. My reputation score really sux.
properties (22)
authorurbansteemers
permlinkre-roelandp-basic-witness-tasks-health-check-python-script-20171007t000601777z
categorywitness-category
json_metadata{"tags":["witness-category"],"app":"steemit/0.1"}
created2017-10-07 00:06:06
last_update2017-10-07 00:06:06
depth1
children0
last_payout2017-10-14 00:06:06
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length93
author_reputation83,763,475,248
root_title"Basic witness tasks' health check - python script"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id16,957,309
net_rshares0