create account

Monitoring bots by emrebeyler

View this thread on: hive.blogpeakd.comecency.com
· @emrebeyler · (edited)
$12.82
Monitoring bots
My STEEM related bots are actually long-running processes. They sometimes stop, fail and go offline. It might be an unhandled exception, a network issue, a temporary steem public node issue, etc. You should always log these fuckups. 

However, most of the time a *restart* of the bot is enough to keep things going.

<center><img src="https://media2.giphy.com/media/13FDZn3eBSzmNy/giphy.gif"></center>
<center><sup>Famous quote of <a href="http://www.imdb.com/title/tt0487831/">It Crowd</a>.</sup></center>

I use [Supervisor](http://supervisord.org) to control the processes of the bots. It monitors the processes and can auto-restart if something happens like that. It will also auto-start the scripts if an os reboot happens.

For example, I have [curobot](http://github.com/emre/curobot) as my personal curation bot. It's current config on my machine:

```
command = /var/bots/curobot-env/bin/curobot /var/bots/curobot/config.json
stdout_logfile = /var/logs/curobot.log
stderr_logfile = /var/logs/curobot.log
redirect_stderr = True
redirect_stdout = True
autorestart = True
environment = POSTING_KEY=foo
```

Supervisor daemon also has a neat web interface that, you can actually monitor and manage your processes via the web browser.

*A screenshot from my supervisord setup*

<img src="https://s13.postimg.org/m4wxwp5fr/Screen_Shot_2018-03-19_at_9.38.15_PM.png">

***

I use it for the last 4-5 years. It's a rock-solid solution to manage and monitor the processes. Check [supervisord.org](https://s13.postimg.org/m4wxwp5fr/Screen_Shot_2018-03-19_at_9.38.15_PM.png) for more info.
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 78 others
properties (23)
authoremrebeyler
permlinkmonitoring-bots
categorypython
json_metadata{"community":"busy","app":"busy/2.4.0","format":"markdown","links":["http://www.imdb.com/title/tt0487831/","http://supervisord.org","http://github.com/emre/curobot","https://s13.postimg.org/m4wxwp5fr/Screen_Shot_2018-03-19_at_9.38.15_PM.png"],"image":["https://steemitimages.com/0x0/https://media2.giphy.com/media/13FDZn3eBSzmNy/giphy.gif","https://steemitimages.com/0x0/https://s13.postimg.org/m4wxwp5fr/Screen_Shot_2018-03-19_at_9.38.15_PM.png"],"tags":["python","bots","programming","supervisord","sndbox"]}
created2018-03-19 18:45:33
last_update2018-03-19 18:47:06
depth0
children6
last_payout2018-03-26 18:45:33
cashout_time1969-12-31 23:59:59
total_payout_value11.185 HBD
curator_payout_value1.637 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,587
author_reputation448,535,049,068,622
root_title"Monitoring bots"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id45,396,770
net_rshares3,903,960,957,199
author_curate_reward""
vote details (142)
@isnochys ·
One day I will tell you, what behemoth I build for steem.
But today is not that day. 
Just that much. 
I use crontab:)
properties (22)
authorisnochys
permlinkre-emrebeyler-monitoring-bots-20180319t185420908z
categorypython
json_metadata{"tags":["python"],"app":"steemit/0.1"}
created2018-03-19 18:54:24
last_update2018-03-19 18:54:24
depth1
children2
last_payout2018-03-26 18:54:24
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_length118
author_reputation48,488,212,884,261
root_title"Monitoring bots"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id45,397,952
net_rshares0
@emrebeyler ·
It's not actually a replacement for crontab. I also use crontab for some bots.

This is for the scripts designed to run forever, always listening new blocks, transactions, etc.
properties (22)
authoremrebeyler
permlinkre-isnochys-re-emrebeyler-monitoring-bots-20180319t185554620z
categorypython
json_metadata{"tags":["python"],"app":"steemit/0.1"}
created2018-03-19 18:55:54
last_update2018-03-19 18:55:54
depth2
children1
last_payout2018-03-26 18:55:54
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_length176
author_reputation448,535,049,068,622
root_title"Monitoring bots"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id45,398,145
net_rshares0
@isnochys ·
I tried that too, but streaming is way to unreliable on my old vps for steem. And nodes too.
I have everything in funny cronjobs. 
And lost them at one point to crontab - r
Don't execute that!! E and R are just to close on my mobile phones keyboard. 
Now, all my crontab are also on my git backup:)
But I repeat myself.
properties (22)
authorisnochys
permlinkre-emrebeyler-re-isnochys-re-emrebeyler-monitoring-bots-20180319t191612844z
categorypython
json_metadata{"tags":["python"],"app":"steemit/0.1"}
created2018-03-19 19:16:15
last_update2018-03-19 19:16:15
depth3
children0
last_payout2018-03-26 19:16:15
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_length319
author_reputation48,488,212,884,261
root_title"Monitoring bots"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id45,400,885
net_rshares0
@praguepainter ·
I've been messing around with drdoogie by @inertia, how is your curobot different?
Honestly I'm still so green that I dont get how steembottracker works, but it seems like I'm such a lowlevel plankton that paying for upvotes is basically a waste of my time unless I'm willing to shell out big votes ...
properties (22)
authorpraguepainter
permlinkre-emrebeyler-monitoring-bots-20180319t205500943z
categorypython
json_metadata{"tags":["python"],"users":["inertia"],"app":"steemit/0.1"}
created2018-03-19 20:55:03
last_update2018-03-19 20:55:03
depth1
children0
last_payout2018-03-26 20:55:03
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_length302
author_reputation138,210,477,313
root_title"Monitoring bots"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id45,414,282
net_rshares0
@themarkymark ·
$0.26
I’ve been using pm2 a lot lately, really like it a lot.
👍  ,
properties (23)
authorthemarkymark
permlinkre-emrebeyler-monitoring-bots-20180320t044220274z
categorypython
json_metadata{"tags":["python"],"app":"steemit/0.1"}
created2018-03-20 04:42:21
last_update2018-03-20 04:42:21
depth1
children1
last_payout2018-03-27 04:42:21
cashout_time1969-12-31 23:59:59
total_payout_value0.195 HBD
curator_payout_value0.062 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length55
author_reputation1,773,898,031,206,220
root_title"Monitoring bots"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id45,473,254
net_rshares79,305,688,100
author_curate_reward""
vote details (2)
@therealwolf ·
I'm only using pm2 - super helpful and very reliable.
properties (22)
authortherealwolf
permlinkre-themarkymark-re-emrebeyler-monitoring-bots-20180320t163456432z
categorypython
json_metadata{"tags":["python"],"app":"steemit/0.1"}
created2018-03-20 16:34:54
last_update2018-03-20 16:34:54
depth2
children0
last_payout2018-03-27 16:34:54
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_length53
author_reputation581,207,180,122,024
root_title"Monitoring bots"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id45,579,266
net_rshares0