{"id":23080084,"url":"https://github.com/opsdis/icinga2-passive-replicator","last_synced_at":"2025-04-03T13:42:09.066Z","repository":{"id":57673788,"uuid":"482174304","full_name":"opsdis/icinga2-passive-replicator","owner":"opsdis","description":"The icinga2-passive-replicator, or for short i2pr, is a simple solution to replicate state and performance data for hosts and service from one Icinga2 instance, source, to another instance, sink.","archived":false,"fork":false,"pushed_at":"2022-04-16T14:35:01.000Z","size":44,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-09T14:47:05.842Z","etag":null,"topics":["icinga2","replication"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/opsdis.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":"2022-04-16T06:22:00.000Z","updated_at":"2022-04-16T13:53:45.000Z","dependencies_parsed_at":"2022-08-31T14:02:16.607Z","dependency_job_id":null,"html_url":"https://github.com/opsdis/icinga2-passive-replicator","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opsdis%2Ficinga2-passive-replicator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opsdis%2Ficinga2-passive-replicator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opsdis%2Ficinga2-passive-replicator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opsdis%2Ficinga2-passive-replicator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opsdis","download_url":"https://codeload.github.com/opsdis/icinga2-passive-replicator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247013306,"owners_count":20869245,"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":["icinga2","replication"],"created_at":"2024-12-16T13:04:27.037Z","updated_at":"2025-04-03T13:42:09.021Z","avatar_url":"https://github.com/opsdis.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Python application](https://github.com/opsdis/icinga2-passive-replicator/actions/workflows/python-app.yml/badge.svg)](https://github.com/opsdis/icinga2-passive-replicator/actions/workflows/python-app.yml)\n[![PyPI version](https://badge.fury.io/py/icinga2-passive-replicator.svg)](https://badge.fury.io/py/icinga2-passive-replicator)\n\nicinga2-passive-replicator\n--------------------------\n\n# Overview\nThe icinga2-passive-replicator, or for short `i2pr`, is a simple solution to replicate state and performance\ndata for hosts and service from one Icinga2 instance, source, to another instance, sink.\n\nThe solution will scrape the source Icinga2 instance on a regular interval of 60 seconds. \nThe scraping is done for all hosts and services that belong to a number of specified hostgroups.\nWhich hostgroups to scrape is specified with the environment variable `I2PR_SOURCE_HOSTGROUPS`, e.g.\n\n    I2PR_SOURCE_HOSTGROUPS=\"Ubuntu, Mysql\"\n\nThe above will scrape all hosts and services in the hostgroups `Ubuntu` and `Mysql`.\n\nIf a host or service does not exist in the sink instance it will be created.\nThe objects will be created with the templates. Default for hosts is `generic-host`\nand for services is `generic-service`.\n\nDefault check command will be `dummy`.\n\nCreated host and service will always have a variable called `i2pr` set to `true` and be added to hostgroup(s) \ndefined in the environment variable `I2PR_SINK_HOSTGROUPS`, default is `i2pr`.\n\nAll existing variables on the object will be created, but with a prefix default to `i2pr_`.\n\nCheck out the `.example_env` file for configuration options. For the options to take effect please\nrename the file to `.env` or set the options as environment variables.\n\n\u003e If a host/service exists on the source, but have never been executed there will be no state or performance data.\nIn this case the host/service will not be replicated until it have been executed for the first time.\n\n\u003e If a host on the source have a state except 0 (UP) or 1 (DOWN), like 2 or 3 the state will on the sink be set \nto 1. This is due to the passive check API for a host only accept 0 or 1.\n\n# Run i2pr\nEdit the `.env` and `logging.conf` files according to your setup. Please check out `.example_env` for configuration of\nthe `.env` file.\n\n```bash\npython3 -m venv venv\n. venv/bin/activate\npip install -r requierments.txt\npython -m icinga2_passive_replicator\n```\n\n# Run i2pr as a service\nCheckout the example in `scripts/i2pr.service`. The script expect that i2pr is installed in /opt as \n`/opt/i2pr`.\n\n# Run i2pr as a docker\n\nBuild the docker image\n\n    docker build -t icinga2_passive_replicator .\n\nRun the image with mount volumes for configuration\n\n    docker run -v $(pwd)/.env:/app/.env -v $(pwd)/logging.conf:/app/logging.conf icinga2_passive_replicator\n\n# Monitor i2pr\nThe service expose the following endpoint:\n\n- `/health` return http status 200 if okay or 503 if not\n- `/metrics` return the internal metrics, default i prometheus format. Using query parameter `format=json` the\noutput will be json formatted","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopsdis%2Ficinga2-passive-replicator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopsdis%2Ficinga2-passive-replicator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopsdis%2Ficinga2-passive-replicator/lists"}