{"id":13463288,"url":"https://github.com/kostya/eye","last_synced_at":"2025-05-14T08:07:21.909Z","repository":{"id":6137663,"uuid":"7366351","full_name":"kostya/eye","owner":"kostya","description":"Process monitoring tool. Inspired from Bluepill and God.","archived":false,"fork":false,"pushed_at":"2021-11-13T07:29:26.000Z","size":2187,"stargazers_count":1187,"open_issues_count":19,"forks_count":86,"subscribers_count":37,"default_branch":"master","last_synced_at":"2025-05-03T09:04:25.983Z","etag":null,"topics":["daemonize","monitoring","process-monitor","tool"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kostya.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-12-29T12:48:39.000Z","updated_at":"2025-04-30T11:06:32.000Z","dependencies_parsed_at":"2022-08-21T00:50:59.082Z","dependency_job_id":null,"html_url":"https://github.com/kostya/eye","commit_stats":null,"previous_names":[],"tags_count":44,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kostya%2Feye","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kostya%2Feye/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kostya%2Feye/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kostya%2Feye/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kostya","download_url":"https://codeload.github.com/kostya/eye/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253060435,"owners_count":21847526,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["daemonize","monitoring","process-monitor","tool"],"created_at":"2024-07-31T13:00:49.915Z","updated_at":"2025-05-14T08:07:21.845Z","avatar_url":"https://github.com/kostya.png","language":"Ruby","readme":"Eye\n===\n[![Gem Version](https://badge.fury.io/rb/eye.png)](http://rubygems.org/gems/eye)\n[![Build Status](https://secure.travis-ci.org/kostya/eye.png?branch=master)](http://travis-ci.org/kostya/eye)\n[![Coverage Status](https://coveralls.io/repos/kostya/eye/badge.png?branch=master)](https://coveralls.io/r/kostya/eye?branch=master)\n\nProcess monitoring tool. Inspired from Bluepill and God. Requires Ruby(MRI) \u003e= 1.9.3-p194. Uses Celluloid and Celluloid::IO.\n\nLittle demo, shows general commands and how chain works:\n\n[![Eye](https://raw.github.com/kostya/stuff/master/eye/eye.png)](https://raw.github.com/kostya/stuff/master/eye/eye.gif)\n\nInstallation:\n\n    $ gem install eye\n\n\n###  Why?\n\nWe have used god and bluepill in production and always ran into bugs (segfaults, crashes, lost processes, kill not-related processes, load problems, deploy problems, ...)\n\nWe wanted something more robust and production stable.\n\nWe wanted the features of bluepill and god, with a few extras like chains, nested configuring, mask matching, easy debug configs\n\nI hope we've succeeded, we're using eye in production and are quite happy.\n\n###  Config example\n\nexamples/test.eye ([more examples](https://github.com/kostya/eye/tree/master/examples))\n```ruby\n# load submodules, here just for example\nEye.load('./eye/*.rb')\n\n# Eye self-configuration section\nEye.config do\n  logger '/tmp/eye.log'\nend\n\n# Adding application\nEye.application 'test' do\n  # All options inherits down to the config leafs.\n  # except `env`, which merging down\n\n  # uid \"user_name\" # run app as a user_name (optional) - available only on ruby \u003e= 2.0\n  # gid \"group_name\" # run app as a group_name (optional) - available only on ruby \u003e= 2.0\n\n  working_dir File.expand_path(File.join(File.dirname(__FILE__), %w[ processes ]))\n  stdall 'trash.log' # stdout,err logs for processes by default\n  env 'APP_ENV' =\u003e 'production' # global env for each processes\n  trigger :flapping, times: 10, within: 1.minute, retry_in: 10.minutes\n  check :cpu, every: 10.seconds, below: 100, times: 3 # global check for all processes\n\n  group 'samples' do\n    chain grace: 5.seconds # chained start-restart with 5s interval, one by one.\n\n    # eye daemonized process\n    process :sample1 do\n      pid_file '1.pid' # pid_path will be expanded with the working_dir\n      start_command 'ruby ./sample.rb'\n\n      # when no stop_command or stop_signals, default stop is [:TERM, 0.5, :KILL]\n      # default `restart` command is `stop; start`\n\n      daemonize true\n      stdall 'sample1.log'\n\n      # ensure the CPU is below 30% at least 3 out of the last 5 times checked\n      check :cpu, below: 30, times: [3, 5]\n    end\n\n    # self daemonized process\n    process :sample2 do\n      pid_file '2.pid'\n      start_command 'ruby ./sample.rb -d --pid 2.pid --log sample2.log'\n      stop_command 'kill -9 {PID}'\n\n      # ensure the memory is below 300Mb the last 3 times checked\n      check :memory, every: 20.seconds, below: 300.megabytes, times: 3\n    end\n  end\n\n  # daemon with 3 children\n  process :forking do\n    pid_file 'forking.pid'\n    start_command 'ruby ./forking.rb start'\n    stop_command 'ruby forking.rb stop'\n    stdall 'forking.log'\n\n    start_timeout 10.seconds\n    stop_timeout 5.seconds\n\n    monitor_children do\n      restart_command 'kill -2 {PID}' # for this child process\n      check :memory, below: 300.megabytes, times: 3\n    end\n  end\n\n  # eventmachine process, daemonized with eye\n  process :event_machine do\n    pid_file 'em.pid'\n    start_command 'ruby em.rb'\n    stdout 'em.log'\n    daemonize true\n    stop_signals [:QUIT, 2.seconds, :KILL]\n\n    check :socket, addr: 'tcp://127.0.0.1:33221', every: 10.seconds, times: 2,\n                   timeout: 1.second, send_data: 'ping', expect_data: /pong/\n  end\n\n  # thin process, self daemonized\n  process :thin do\n    pid_file 'thin.pid'\n    start_command 'bundle exec thin start -R thin.ru -p 33233 -d -l thin.log -P thin.pid'\n    stop_signals [:QUIT, 2.seconds, :TERM, 1.seconds, :KILL]\n\n    check :http, url: 'http://127.0.0.1:33233/hello', pattern: /World/,\n                 every: 5.seconds, times: [2, 3], timeout: 1.second\n  end\nend\n```\n\n### Start eye daemon and/or load config:\n\n    $ eye l(oad) examples/test.eye\n\nload folder with configs:\n\n    $ eye l examples/\n    $ eye l examples/*.rb\n\nforeground load:\n\n    $ eye l CONF -f\n\nIf the eye daemon has already started and you call the `load` command, the config will be updated (into eye daemon). New objects(applications, groups, processes) will be added and monitored. Processes removed from the config will be removed (and stopped if the process has `stop_on_delete true`). Other objects will update their configs.\n\nTwo global configs loaded by default, if they exist (with the first eye load):\n\n    /etc/eye.conf\n    ~/.eyeconfig\n\nProcess statuses:\n\n    $ eye i(nfo)\n\n```\ntest\n  samples\n    sample1 ....................... up  (21:52, 0%, 13Mb, \u003c4107\u003e)\n    sample2 ....................... up  (21:52, 0%, 12Mb, \u003c4142\u003e)\n  event_machine ................... up  (21:52, 3%, 26Mb, \u003c4112\u003e)\n  forking ......................... up  (21:52, 0%, 41Mb, \u003c4203\u003e)\n    child-4206 .................... up  (21:52, 0%, 41Mb, \u003c4206\u003e)\n    child-4211 .................... up  (21:52, 0%, 41Mb, \u003c4211\u003e)\n    child-4214 .................... up  (21:52, 0%, 41Mb, \u003c4214\u003e)\n  thin ............................ up  (21:53, 2%, 54Mb, \u003c4228\u003e)\n```\n\n    $ eye i -j # show info in JSON format\n\n### Commands:\n\n    start, stop, restart, delete, monitor, unmonitor\n\nCommand params (with restart for example):\n\n    $ eye r(estart) all\n    $ eye r test\n    $ eye r samples\n    $ eye r sample1\n    $ eye r sample*\n    $ eye r test:samples\n    $ eye r test:samples:sample1\n    $ eye r test:samples:sample*\n    $ eye r test:*sample*\n\nCheck config syntax:\n\n    $ eye c(heck) examples/test.eye\n\nConfig explain (for debug):\n\n    $ eye e(xplain) examples/test.eye\n\nLog tracing (tail and grep):\n\n    $ eye t(race)\n    $ eye t test\n    $ eye t sample\n\nQuit monitoring:\n\n    $ eye q(uit)\n    $ eye q -s # stop all processes and quit\n\nInteractive info:\n\n    $ eye w(atch)\n\nProcess statuses history:\n\n    $ eye hi(story)\n\nEye daemon info:\n\n    $ eye x(info)\n    $ eye x -c # for show current config\n\nLocal Eye version LEye (like foreman):\n\n[LEye](https://github.com/kostya/eye/wiki/What-is-loader_eye-and-leye)\n\nProcess states and events:\n\n[![Eye](https://raw.github.com/kostya/stuff/master/eye/mprocess.png)](https://raw.github.com/kostya/stuff/master/eye/process.png)\n\nHow to write Eye extensions, plugins, gems:\n\n[Eye-http](https://github.com/kostya/eye-http) [Eye-rotate](https://github.com/kostya/eye-rotate) [Eye-hipchat](https://github.com/tmeinlschmidt/eye-hipchat) [Plugin example](https://github.com/kostya/eye/tree/master/examples/plugin)\n\n[Eye related projects](https://github.com/kostya/eye/wiki/Related-projects)\n\n[Articles](https://github.com/kostya/eye/wiki/Articles)\n\n[Wiki](https://github.com/kostya/eye/wiki)\n\n\nThanks `Bluepill` for the nice config ideas.\n","funding_links":[],"categories":["Maintenance \u0026 Monitoring","Ruby","Process Management and Monitoring","Tools","Process Monitoring"],"sub_categories":["Server Monitoring","Other tools"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkostya%2Feye","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkostya%2Feye","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkostya%2Feye/lists"}