gobeat is a health check monitor, command automation tool and a process restarter, for any process found by name or pid.
go get -u github.com/radovskyb/gobeat
gobeat -pid=1234 -cmd="go run myscript.go"
gobeat -name="subl" -cmd="./mybashscript"
sudo gobeat -pid=1234 -cmd="go run sendemail.go"
- Run with
gobeatwill restart the server in the same terminal tty that it originated in. (
gobeatto the process of the running server that you want
gobeatto monitor. (
- Set the
cmdflag to run a
Gofile that will send an email notifying you that the server was restarted. (
-cmd="go run sendemail.go")
- Make health check poll interval customizable.
- Write some tests.
gobeat is started by passing it a minimum flag that it requires to work, either a
pid (process id) which can be found using
ps in the terminal, or a
name which finds and lists all processes containing that name, where the correct process is then chosen from the list.
gobeat regularly health checks the running process.
If the process has been shut down and the
restart flag is set to true, which is the default,
gobeat automatically restarts the process.
When the process that needs to be restarted was instantiated in a terminal window, for example,
gobeat automatically restarts the process in the
tty that it originated in (requires sudo).
For processes not started in a terminal,
gobeat will simply restart the application.
detach flag specifes whether or not an application that is restarted gets attached to
gobeat's process. An
attached process will be killed when
gobeat is killed, whereas a
deatched process will continue to run.
gobeat also accepts a
cmd flag, which specifies a command to be run anytime the process being watched is killed or restarted.
ps for finding process information since
/proc/ is not available on MacOS.