{"id":22894241,"url":"https://github.com/clearcodehq/ianitor","last_synced_at":"2025-07-13T08:04:57.502Z","repository":{"id":22477990,"uuid":"25817032","full_name":"ClearcodeHQ/ianitor","owner":"ClearcodeHQ","description":"Doorkeeper for consul discovered services","archived":false,"fork":false,"pushed_at":"2018-05-03T12:57:53.000Z","size":54,"stargazers_count":76,"open_issues_count":4,"forks_count":20,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-04-17T03:45:09.149Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ClearcodeHQ.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-10-27T12:01:46.000Z","updated_at":"2024-11-28T16:30:13.000Z","dependencies_parsed_at":"2022-08-21T05:30:59.617Z","dependency_job_id":null,"html_url":"https://github.com/ClearcodeHQ/ianitor","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClearcodeHQ%2Fianitor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClearcodeHQ%2Fianitor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClearcodeHQ%2Fianitor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClearcodeHQ%2Fianitor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ClearcodeHQ","download_url":"https://codeload.github.com/ClearcodeHQ/ianitor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252941338,"owners_count":21828857,"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":[],"created_at":"2024-12-13T23:17:17.002Z","updated_at":"2025-05-07T19:20:47.218Z","avatar_url":"https://github.com/ClearcodeHQ.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/ClearcodeHQ/ianitor.svg?branch=master)](https://travis-ci.org/ClearcodeHQ/ianitor)\n[![Coverage Status](https://img.shields.io/coveralls/ClearcodeHQ/ianitor.svg)](https://coveralls.io/r/ClearcodeHQ/ianitor)\n\n# ianitor\n\n**ianitor** is a doorkeeper for your services discovered using\n[consul](https://www.consul.io/). It can automatically register new services\nthrough consul API and manage TTL health checks.\n \nIt provides simple shell command that wraps process and can be simply used in\nyour existing process/service supervision tool like \n[supervisord](http://supervisord.org/), \n[circus](http://circus.readthedocs.org/en/0.11.1/),\n[runit](http://smarden.org/runit/) etc.\n\n## Consul/Python versions compatibility\n\n**ianitor** is compatibile with Python 2.7, 3.3, 3.4, and 3.5 versions.\nIt is also tested against each latest patch version of every major/minor consul\nrelease starting from 0.4.1 version.\n\nFor details of our test matrix see `travis.yml` file.\n\n## Installation and usage\n\nSimply install with pip:\n\n    $ pip install ianitor\n    \nAnd you're ready to go with:\n\n    $ ianitor appname -- ./yourapp --some-switch\n    \nYou can check if service is registered diggin' into consul DNS service:\n\n```console\n$ dig @localhost -p 8600 appname.service.consul\n; \u003c\u003c\u003e\u003e DiG 9.9.3-P1 \u003c\u003c\u003e\u003e @localhost -p 8600 appname.service.consul\n; (1 server found)\n;; global options: +cmd\n;; Got answer:\n;; -\u003e\u003eHEADER\u003c\u003c- opcode: QUERY, status: NOERROR, id: 25966\n;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0\n;; WARNING: recursion requested but not available\n\n;; QUESTION SECTION:\n;appname.service.consul.\t\tIN\tA\n\n;; ANSWER SECTION:\nappname.service.consul.\t0\tIN\tA\t10.54.54.214\n\n;; Query time: 44 msec\n;; SERVER: 127.0.0.1#8600(127.0.0.1)\n;; WHEN: Tue Oct 28 13:53:09 CET 2014\n;; MSG SIZE  rcvd: 78\n```\n\nFull usage:\n\n    usage: ianitor [-h] [--consul-agent hostname[:port]] [--ttl seconds]\n                   [--heartbeat seconds] [--tags tag] [--id ID] [--port PORT] [-v]\n                   service-name -- command [arguments]\n    \n    Doorkeeper for consul discovered services.\n    \n    positional arguments:\n      service-name                    service name in consul cluster\n    \n    optional arguments:\n      -h, --help                      show this help message and exit\n      --consul-agent=hostname[:port]  set consul agent address\n      --ttl=seconds                   set TTL of service in consul cluster\n      --heartbeat=seconds             set process poll heartbeat (defaults to\n                                      ttl/10)\n      --tags=tag                      set service tags in consul cluster (can be\n                                      used multiple times)\n      --id=ID                         set service id - must be node unique\n                                      (defaults to service name)\n      --address=hostname              set service address (if different than agent\n                                      address)\n      --port=PORT                     set service port\n      -v, --verbose                   enable logging to stdout (use multiple times\n                                      to increase verbosity)\n\n\n## How does ianitor work?\n\nianitor spawns process using python's `subprocess.Popen()` with command line\nspecified after `--` . It redirects its own stdin to child's stdin and\nchilds stdout/stderr to his own stdout/stderr.\n\nThis way ianitor does not interfere with logging of managed service if it\nlogs to stdout. Moreover ianitor does not log anything to make it easier to\nplug it in your existing process supervision tool.\n\nianitor handles service registration in consul agent as well as keeping\nregistered service entry in consul in \"healthy\" state by continously requesting\nit's [TTL health check endpoint](http://www.consul.io/docs/agent/checks.html).\n\n## Example supervisord config\n\nAssuming that you have some service under supervisord supervision:\n\n```ini\n[program:rabbitmq]\ncommand=/usr/sbin/rabbitmq-server\npriority=0\n\nautostart=true\n```\n\nSimply wrap it with ianitor call:\n\n```ini\n[program:rabbitmq]\ncommand=/usr/local/bin/ianitor rabbitmq -- /usr/sbin/rabbitmq-server\npriority=0\n\nautostart=true\n```\n\n## Licence\n\n`ianitor`  is licensed under LGPL license, version 3.\n\n\n## Contributing and reporting bugs\n\nSource code is available at:\n[ClearcodeHQ/ianitor](https://github.com/ClearcodeHQ/ianitor). Issue tracker\nis located at [GitHub Issues](https://github.com/ClearcodeHQ/ianitor/issues).\nProjects [PyPi page](https://pypi.python.org/pypi/ianitor).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclearcodehq%2Fianitor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclearcodehq%2Fianitor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclearcodehq%2Fianitor/lists"}