{"id":23080086,"url":"https://github.com/opsdis/indis","last_synced_at":"2025-07-01T02:36:53.047Z","repository":{"id":62570924,"uuid":"445496039","full_name":"opsdis/indis","owner":"opsdis","description":"indis - Icinga native director import service","archived":false,"fork":false,"pushed_at":"2022-01-07T13:33:14.000Z","size":76,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-03T13:44:24.935Z","etag":null,"topics":["icinga","monitoring","observability"],"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-01-07T11:19:43.000Z","updated_at":"2022-01-07T13:03:43.000Z","dependencies_parsed_at":"2022-11-03T17:15:41.121Z","dependency_job_id":null,"html_url":"https://github.com/opsdis/indis","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/opsdis/indis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opsdis%2Findis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opsdis%2Findis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opsdis%2Findis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opsdis%2Findis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opsdis","download_url":"https://codeload.github.com/opsdis/indis/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opsdis%2Findis/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262884246,"owners_count":23379358,"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":["icinga","monitoring","observability"],"created_at":"2024-12-16T13:04:28.236Z","updated_at":"2025-07-01T02:36:53.021Z","avatar_url":"https://github.com/opsdis.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![PyPI version](https://badge.fury.io/py/indis.svg)](https://badge.fury.io/py/indis)\n\nindis - Icinga native director import service\n----------------------------------------------\n\n\u003e This project is currently in beta so API's and functionallity may change. Looking forward to your feedback and pull\n\u003e requests.\n\n# Overview \n\nIndis is a configuration tool for Icinga2 and integrates with the Icinga2 module Director. \nWith Indis it possible to read data from other system that provide data that can be used to create\nIcinga2 objects, like hosts, hostgroups, services, servicegroups, dependency etc.\n\nThe source system is read by Indis source providers. A provider mediate between the source native data model and \ndata formats to native Icinga2 objects. A provider is typical something that is customized for a specific source \nsystem, e.g. a network management system where all routers and switches is managed. \n\nAfter the provider has created the icinga objects, the data is processed by a number of configurable processors. \nA processor can typical be logic that enrich or transform the icinga objects in some way, e.g. adding hostgroups, \nadding host and service vars etc.\n\nThe final step is to generate the data output, the output data that should be processed by Icinga2 Director.\n\nThe major benefit using Indis compared to other integrations like a custom json, a sql table etc, is that all\noutput from Indis follow the Icinga2 objects structure and naming. This means that all Director configuration, like \nimport rules, sync rules, apply rules etc., just needs to operate on the \"native\" icinga2 object model. \nInstead of writing different rules and configuration depending on the structure of the source, Indis manage that \nseparation and abstraction.\n\n**That's why we call it \"Icinga native director import service\".**\n\nUsing Indis it simple to automate Icinga2 configuration with different systems, including gitops driven CI/CD \npipelines. All the benefits of Icinga director, Icinga DSL and with the power of Python.\n\n\u003e Currently, Indis do not support configuration and management of apply rules. Existing apply rules in Icinga2 \n\u003e will of course be executed if matched.\n\n# Use Icinga2 DSL\n\nOne key benefit with Icinga2 Director is to use the Icinga DSL to provide logic on how to connect objects together.\nTypical the DSL can be used to connect services to hosts. Instead of creating unique services for a host, \nuse service templates and apply these based on host attributes like variables, hostgroups etc.\n\nWith Indis you get all the benefits of the Icinga DSL, but all the benefits of simple python development to \nextract source system data and create all kinds of Icinga objects.\n\n# Get started\n\nFor more hands on and get started check out the `config.yml` and the `demo` provider.\n    \n    python -m indis -f config.yml -s demo_source\n\n\n# Output plugins \n\nTwo output plugins are available, a json file plugin and an Icinga2 director API plugin.\n\n## The json file output plugin\n\nThe json file output plugin can be used with fileshipper.\n\nCheck out the config:\n```yaml\noutput:\n  writer: indis.output.json_writer.JsonFileWriter\n  configuration:\n    directory: /tmp/director\n```\nThe output will be written to the `directory`, with one file for each object typ.\n\n## The Icinga2 director API output plugin\n\nThe output plugin will create and update objects using the Icinga2 director REST API.\nDelete operations are only supported if a cache store is created. \n\nConfiguration for the output plugin is:\n```yaml\noutput:\n  \n  writer: indis.output.api_writer.APIWriter\n  configuration:\n    url: http://localhost/icingaweb2/director\n    user: user\n    password: password\n```\nThe user must be an existing icinga2 web user with credentials for Director API.\n\n\n# Source provider\n\nA source provider is implemented as a class that must inherit the Source class.\n\n```pyhton\nclass Source:\n\n    def __init__(self, config: Configuration, reader: SourceReader):\n        self.config = config\n        self.reader = reader\n\n    @abstractmethod\n    def fetch(self) -\u003e Transfer:\n        pass\n```\nThe field `config` give access to all source specific config in the named source section of the yaml configuration \nfile. The `reader` field give access to the provider specific reader object that indis creates.\n\nThe provider reader class must implement the SourceReader.\n\n```python\nclass SourceReader:\n\n    def __init__(self, config: Configuration):\n        \"\"\"\n        Cofiguration is the section of source\n        :param config:\n        \"\"\"\n        self.config = config\n```\n \nPlease see the example code in the `demo` directory.\n\n\u003e If you know Mender, you will recognize the programming structure of Indis providers.\n\n# Cache \nIf a cache is used it is possible for Indis to understand if object should be removed if not longer existing in \nthe source.\n\n## Redis cache\nEvery key in redis is prefixed with the source identifier. \nEach object type will have a `SET` that keep track of the current configured object of a specific type \nwith the format `\u003csource\u003e:\u003ctype\u003e`, where type is in plurals e.g. `hosts`.\n\n    127.0.0.1:6379\u003e type demo_source:hosts\n    set\n\nFor example:\n\n    127.0.0.1:6379\u003e SMEMBERS demo_source:hosts\n    1) \"www.sunet.se\"\n    2) \"www.opsdis.com\"\n\nFor each object a key is named by type and name that include the sha of the current configured object \n`\u003csource\u003e:\u003ctype\u003e:\u003cname\u003e`\n\n    127.0.0.1:6379\u003e type demo_source:hosts:www.sunet.se\n    string\n\nFor example:\n\n    127.0.0.1:6379\u003e get \"demo_source:hosts:www.sunet.se\"\n    \"4805c225b5543ea62e76503f2778e2f145908c4a26690c83b3d471bc0f9b3e07\"\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopsdis%2Findis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopsdis%2Findis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopsdis%2Findis/lists"}