infoblox-discovery


Nameinfoblox-discovery JSON
Version 0.2.0 PyPI version JSON
download
home_pagehttps://github.com/thenodon/infoblox_discovery
SummaryA Prometheus file and http discovery for infoblox
upload_time2023-08-17 14:58:15
maintainer
docs_urlNone
authorthenodon
requires_python>=3.8
licenseGPLv3
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            infoblox-discovery
---------------------

# Overview
The infoblox-discovery service collect different data from a Infloblox master server about
different objects that can be monitored by Prometheus using different exporters as the 
blackbox-exporter and [infoblox-exporter](https://github.com/thenodon/infoblox-exporter). 
The current supporter objects are:
- members
- nodes
- dns_servers
- dhcp_ranges
- zones
- web_endpoints

# Labels naming (since 0.2.0)
All labels are returned prefixed as `__meta_infoblox_`

# Design
The infoblox-discovery can run in 2 modes, as file discovery or as http discovery.
In http discovery mode the infoblox-discovery will run as a http service that Prometheus can
access using http_discovery.
In file discovery the infoblox-discovery will just create Prometheus file discovery files.

When running in http discovery mode the collection of data is done on an interval, default every
3600 sec, and the data is cached. The main reason is to limit a high number of calls to the 
infoblox master server.

## Zones
The query is based on object 'zone_auth' with the query where 'view' is 'External'.
The logic detect reverse and fqdn based zones.

## Web endpoints
These fqdn "hosts" that are based on networks, e.g. `192.91.218.0/24`. 
The result is based on two queries.
1. Get all ipv4address from the network where type is `HOST`
2. For all the above get all `dns_aliases` from `record:host` and check if `External` is in the
`_ref` string

The networks that are subject to be scraped is based on the networks defined in the 
configuration file, see below.

# Configuration
See the `example_config.yml` file.


# Run 
## Environment variables 
- INFOBLOX_DISCOVERY_CONFIG - the configuration file, default to `config.yml`
- INFOBLOX_DISCOVERY_PROMETHEUS_SD_FILE_DIRECTORY - the directory where file discovery based 
will be created, no default only used when run for file discovery
- INFOBLOX_DISCOVERY_HOST - the host to run the discovery service, default `0.0.0.0`
- INFOBLOX_DISCOVERY_PORT - the port to run the discovery service, default `9694`
- INFOBLOX_DISCOVERY_BASIC_AUTH_USERNAME - the basic auth username to the discovery service, no default.
- INFOBLOX_DISCOVERY_BASIC_AUTH_PASSWORD - the basic auth username to the discovery service, no default.
- INFOBLOX_DISCOVERY_LOG_FILE - log file, default stdout
- INFOBLOX_DISCOVERY_LOG_LEVEL - the log level, default `INFO`
- INFOBLOX_DISCOVERY_CACHE_TTL - the discovered data ttl in seconds, must be higher than 
INFOBLOX_DISCOVERY_FETCH_INTERVAL, default `7200`
- INFOBLOX_DISCOVERY_FETCH_INTERVAL - the interval to collect discover data, default `3600`   

> INFOBLOX_DISCOVERY_BASIC_AUTH_USERNAME and INFOBLOX_DISCOVERY_BASIC_AUTH_PASSWORD must
> be set - the discovery can not run without basic authentication.

## File discovery mode
```shell
python -m infoblox_discovery
```
## Http discovery mode
```shell
python -m infoblox_discovery --server
```

# Test 
```shell
curl -s 'localhost:9694/prometheus-sd-targets?master=infoblox.foo.com&type=members'
```
The `master` must match the master entry in the configuration file.
The type can be:
- members
- nodes
- dns_servers
- dhcp_ranges
- zones
- web_endpoints

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/thenodon/infoblox_discovery",
    "name": "infoblox-discovery",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "",
    "author": "thenodon",
    "author_email": "aha@ingby.com",
    "download_url": "https://files.pythonhosted.org/packages/8a/70/b31c53c7d32a5a6cd181f678487203b4181b7573e592296d1d82c24b1ac6/infoblox-discovery-0.2.0.tar.gz",
    "platform": null,
    "description": "infoblox-discovery\n---------------------\n\n# Overview\nThe infoblox-discovery service collect different data from a Infloblox master server about\ndifferent objects that can be monitored by Prometheus using different exporters as the \nblackbox-exporter and [infoblox-exporter](https://github.com/thenodon/infoblox-exporter). \nThe current supporter objects are:\n- members\n- nodes\n- dns_servers\n- dhcp_ranges\n- zones\n- web_endpoints\n\n# Labels naming (since 0.2.0)\nAll labels are returned prefixed as `__meta_infoblox_`\n\n# Design\nThe infoblox-discovery can run in 2 modes, as file discovery or as http discovery.\nIn http discovery mode the infoblox-discovery will run as a http service that Prometheus can\naccess using http_discovery.\nIn file discovery the infoblox-discovery will just create Prometheus file discovery files.\n\nWhen running in http discovery mode the collection of data is done on an interval, default every\n3600 sec, and the data is cached. The main reason is to limit a high number of calls to the \ninfoblox master server.\n\n## Zones\nThe query is based on object 'zone_auth' with the query where 'view' is 'External'.\nThe logic detect reverse and fqdn based zones.\n\n## Web endpoints\nThese fqdn \"hosts\" that are based on networks, e.g. `192.91.218.0/24`. \nThe result is based on two queries.\n1. Get all ipv4address from the network where type is `HOST`\n2. For all the above get all `dns_aliases` from `record:host` and check if `External` is in the\n`_ref` string\n\nThe networks that are subject to be scraped is based on the networks defined in the \nconfiguration file, see below.\n\n# Configuration\nSee the `example_config.yml` file.\n\n\n# Run \n## Environment variables \n- INFOBLOX_DISCOVERY_CONFIG - the configuration file, default to `config.yml`\n- INFOBLOX_DISCOVERY_PROMETHEUS_SD_FILE_DIRECTORY - the directory where file discovery based \nwill be created, no default only used when run for file discovery\n- INFOBLOX_DISCOVERY_HOST - the host to run the discovery service, default `0.0.0.0`\n- INFOBLOX_DISCOVERY_PORT - the port to run the discovery service, default `9694`\n- INFOBLOX_DISCOVERY_BASIC_AUTH_USERNAME - the basic auth username to the discovery service, no default.\n- INFOBLOX_DISCOVERY_BASIC_AUTH_PASSWORD - the basic auth username to the discovery service, no default.\n- INFOBLOX_DISCOVERY_LOG_FILE - log file, default stdout\n- INFOBLOX_DISCOVERY_LOG_LEVEL - the log level, default `INFO`\n- INFOBLOX_DISCOVERY_CACHE_TTL - the discovered data ttl in seconds, must be higher than \nINFOBLOX_DISCOVERY_FETCH_INTERVAL, default `7200`\n- INFOBLOX_DISCOVERY_FETCH_INTERVAL - the interval to collect discover data, default `3600`   \n\n> INFOBLOX_DISCOVERY_BASIC_AUTH_USERNAME and INFOBLOX_DISCOVERY_BASIC_AUTH_PASSWORD must\n> be set - the discovery can not run without basic authentication.\n\n## File discovery mode\n```shell\npython -m infoblox_discovery\n```\n## Http discovery mode\n```shell\npython -m infoblox_discovery --server\n```\n\n# Test \n```shell\ncurl -s 'localhost:9694/prometheus-sd-targets?master=infoblox.foo.com&type=members'\n```\nThe `master` must match the master entry in the configuration file.\nThe type can be:\n- members\n- nodes\n- dns_servers\n- dhcp_ranges\n- zones\n- web_endpoints\n",
    "bugtrack_url": null,
    "license": "GPLv3",
    "summary": "A Prometheus file and http discovery for infoblox",
    "version": "0.2.0",
    "project_urls": {
        "Homepage": "https://github.com/thenodon/infoblox_discovery"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6854d76c7001533d9e60849d1848e568d6b31c672ab3dbbe3a2ee205b5a08cb1",
                "md5": "948a35a3afc6f6092cefeaae14875ba5",
                "sha256": "6db2ed909749787b2bc557826fac45a13a6b3fe18b13d671bf5d046704e51cbf"
            },
            "downloads": -1,
            "filename": "infoblox_discovery-0.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "948a35a3afc6f6092cefeaae14875ba5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 39308,
            "upload_time": "2023-08-17T14:58:13",
            "upload_time_iso_8601": "2023-08-17T14:58:13.991753Z",
            "url": "https://files.pythonhosted.org/packages/68/54/d76c7001533d9e60849d1848e568d6b31c672ab3dbbe3a2ee205b5a08cb1/infoblox_discovery-0.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8a70b31c53c7d32a5a6cd181f678487203b4181b7573e592296d1d82c24b1ac6",
                "md5": "c4be40823a4fbf409fd57ec2c9603935",
                "sha256": "bbba63ea911d65031419bde83553f1c88bc996a6b1ac1ebf1911ec1f7ab7cc80"
            },
            "downloads": -1,
            "filename": "infoblox-discovery-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "c4be40823a4fbf409fd57ec2c9603935",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 26956,
            "upload_time": "2023-08-17T14:58:15",
            "upload_time_iso_8601": "2023-08-17T14:58:15.955463Z",
            "url": "https://files.pythonhosted.org/packages/8a/70/b31c53c7d32a5a6cd181f678487203b4181b7573e592296d1d82c24b1ac6/infoblox-discovery-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-17 14:58:15",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "thenodon",
    "github_project": "infoblox_discovery",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "infoblox-discovery"
}
        
Elapsed time: 0.18774s