nakivo-prometheus-exporter


Namenakivo-prometheus-exporter JSON
Version 0.2.3 PyPI version JSON
download
home_pagehttps://github.com/netinvent/nakivo_prometheus_exporter
SummaryConnecto to Nakivo API and export metrics to Prometheus
upload_time2024-04-16 13:23:11
maintainerNone
docs_urlNone
authorNetInvent - Orsiris de Jong
requires_python>=3.6
licenseGPLv3
keywords shell backup prometheus linux cli
VCS
bugtrack_url
requirements ruamel.yaml ofunctions.requestor ofunctions.logger_utils ofunctions.logger_utils gunicorn uvicorn fastapi fastapi-offline pydantic
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![License](https://img.shields.io/badge/license-GPLv3-blu.svg)](https://opensource.org/licenses/GPL-3.0)
[![Percentage of issues still open](http://isitmaintained.com/badge/open/netinvent/nakivo_prometheus_exporter.svg)](http://isitmaintained.com/project/netinvent/nakivo_prometheus_exporter "Percentage of issues still open")
[![GitHub Release](https://img.shields.io/github/release/netinvent/nakivo_prometheus_exporter.svg?label=Latest)](https://github.com/netinvent/nakivo_prometheus_exporter/releases/latest)
[![Linux linter](https://github.com/netinvent/nakivo_prometheus_exporter/actions/workflows/pylint-linux.yaml/badge.svg)](https://github.com/netinvent/nakivo_prometheus_exporter/actions/workflows/pylint-linux.yaml)

## Nakivo Prometheus exporter

This tool connects to Navkio Backup & Replication API endpoints, and fetches licensing and backup  information in order to present this data as prometheus metrics that can be pulled via a `/metrics` endpoint.

## Compatibility

This project has been tested on Nakivo Backup & Replication v9 and v10.  
It runs on most Linux flavors that have Python 3.6+, and can even run on Windows.

So far, Nakivo requires you to have an enterprise plus license to be able to use the API.

Requires python-pip for setup via `dnf install python3-pip` or `apt-get install python3-pip`

## Grafana dashboard

The exporter comes with a basic Grafana Dashboard, showing:
- Licensing status
- Backup states for objects of per job
- Backup sizes
- Backup durations

![image](examples/grafana_dashboard_v0.1b.png)
![image](examples/grafana_dashboard_v0.1.png)

## Quick start

Create a readonly API user (View only role) so your exporter doesn't have more rights than it should.
![image](examples/nakivo_readonly_user.png)


Grab yourself a copy of `nakivo_prometheus_exporter` by running
```
python3 pip install nakivo_prometheus_exporter
```

Create your YAML config file in let's say `/etc/nakivo_prometheus_exporter.yaml`
```
http_server:
  listen: 0.0.0.0
  port: 9119
  username: me
  password: MySecret!Password
  # We usually don't authenticate for prometheus exporters
  no_auth: true
  log_file: /var/log/nakivo_prometheus_exporter.log
nakivo_hosts:
  - MyNakivoHost:
    host: https://mynakivohost.tld:4443
    username: readonly
    password: SomeNicePassword
    cert_verify: False
  - AnotherNakivoHost:
    host: https://othernakivo.local:4443
    username: readonly
    password: OtherPasswrod
    cert_verify: True
```

Once you're done, you can try to run the exporter with
```
nakivo_prometheus_exporter --config-file=/etc/nakivo_prometheus_eporter.yaml
```
Once running, you might want to check the metrics with:
```
curl http://localhost:9119/metrics
```

If everything works, you can use the provided systemd service file from the systemd directory, copy it into `/etc/systemd/system` and run the service with
```
systemctl enable --now nakivo_prometheus_exporter
```

## Caveats

Since on every scraping, the exporter connects to *ALL* Nakivo API endpoints defined in the host section, you should set the scraper interval to something reasonable like 1 hour.

## Other caveats

This is a quick and dirty proof of concept, only fetching  backup states/duration/sizes and licensing state.  
There's still quiescing information missing (didn't find it in the (Nakivo API)[https://helpcenter.nakivo.com/api-reference/Content/API-Reference-Overview.htm])

If some traction is obersved for the project, we might add missing or interesting metrics.

## Running on Windows

While this typically targets Linux, one can run this exporter on Windows, as single threaded instance without concurrency.
Running as service can be achieved via nssm.

## Troubleshooting

You can enable debugging in order to have more info with
```
export _DEBUG=true
/usr/local/bin/nakivo_prometheus_exporter -c /etc/nakivo_prometheus.exporter.yaml
```

## Like it ?

Write us ;)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/netinvent/nakivo_prometheus_exporter",
    "name": "nakivo-prometheus-exporter",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "shell, backup, prometheus, linux, cli",
    "author": "NetInvent - Orsiris de Jong",
    "author_email": "contact@netinvent.fr",
    "download_url": "https://files.pythonhosted.org/packages/bd/5d/c8aa329043a1063db11c0a3d3f015d4f81a83134ab4aea4e5501181dbd95/nakivo_prometheus_exporter-0.2.3.tar.gz",
    "platform": null,
    "description": "[![License](https://img.shields.io/badge/license-GPLv3-blu.svg)](https://opensource.org/licenses/GPL-3.0)\r\n[![Percentage of issues still open](http://isitmaintained.com/badge/open/netinvent/nakivo_prometheus_exporter.svg)](http://isitmaintained.com/project/netinvent/nakivo_prometheus_exporter \"Percentage of issues still open\")\r\n[![GitHub Release](https://img.shields.io/github/release/netinvent/nakivo_prometheus_exporter.svg?label=Latest)](https://github.com/netinvent/nakivo_prometheus_exporter/releases/latest)\r\n[![Linux linter](https://github.com/netinvent/nakivo_prometheus_exporter/actions/workflows/pylint-linux.yaml/badge.svg)](https://github.com/netinvent/nakivo_prometheus_exporter/actions/workflows/pylint-linux.yaml)\r\n\r\n## Nakivo Prometheus exporter\r\n\r\nThis tool connects to Navkio Backup & Replication API endpoints, and fetches licensing and backup  information in order to present this data as prometheus metrics that can be pulled via a `/metrics` endpoint.\r\n\r\n## Compatibility\r\n\r\nThis project has been tested on Nakivo Backup & Replication v9 and v10.  \r\nIt runs on most Linux flavors that have Python 3.6+, and can even run on Windows.\r\n\r\nSo far, Nakivo requires you to have an enterprise plus license to be able to use the API.\r\n\r\nRequires python-pip for setup via `dnf install python3-pip` or `apt-get install python3-pip`\r\n\r\n## Grafana dashboard\r\n\r\nThe exporter comes with a basic Grafana Dashboard, showing:\r\n- Licensing status\r\n- Backup states for objects of per job\r\n- Backup sizes\r\n- Backup durations\r\n\r\n![image](examples/grafana_dashboard_v0.1b.png)\r\n![image](examples/grafana_dashboard_v0.1.png)\r\n\r\n## Quick start\r\n\r\nCreate a readonly API user (View only role) so your exporter doesn't have more rights than it should.\r\n![image](examples/nakivo_readonly_user.png)\r\n\r\n\r\nGrab yourself a copy of `nakivo_prometheus_exporter` by running\r\n```\r\npython3 pip install nakivo_prometheus_exporter\r\n```\r\n\r\nCreate your YAML config file in let's say `/etc/nakivo_prometheus_exporter.yaml`\r\n```\r\nhttp_server:\r\n  listen: 0.0.0.0\r\n  port: 9119\r\n  username: me\r\n  password: MySecret!Password\r\n  # We usually don't authenticate for prometheus exporters\r\n  no_auth: true\r\n  log_file: /var/log/nakivo_prometheus_exporter.log\r\nnakivo_hosts:\r\n  - MyNakivoHost:\r\n    host: https://mynakivohost.tld:4443\r\n    username: readonly\r\n    password: SomeNicePassword\r\n    cert_verify: False\r\n  - AnotherNakivoHost:\r\n    host: https://othernakivo.local:4443\r\n    username: readonly\r\n    password: OtherPasswrod\r\n    cert_verify: True\r\n```\r\n\r\nOnce you're done, you can try to run the exporter with\r\n```\r\nnakivo_prometheus_exporter --config-file=/etc/nakivo_prometheus_eporter.yaml\r\n```\r\nOnce running, you might want to check the metrics with:\r\n```\r\ncurl http://localhost:9119/metrics\r\n```\r\n\r\nIf everything works, you can use the provided systemd service file from the systemd directory, copy it into `/etc/systemd/system` and run the service with\r\n```\r\nsystemctl enable --now nakivo_prometheus_exporter\r\n```\r\n\r\n## Caveats\r\n\r\nSince on every scraping, the exporter connects to *ALL* Nakivo API endpoints defined in the host section, you should set the scraper interval to something reasonable like 1 hour.\r\n\r\n## Other caveats\r\n\r\nThis is a quick and dirty proof of concept, only fetching  backup states/duration/sizes and licensing state.  \r\nThere's still quiescing information missing (didn't find it in the (Nakivo API)[https://helpcenter.nakivo.com/api-reference/Content/API-Reference-Overview.htm])\r\n\r\nIf some traction is obersved for the project, we might add missing or interesting metrics.\r\n\r\n## Running on Windows\r\n\r\nWhile this typically targets Linux, one can run this exporter on Windows, as single threaded instance without concurrency.\r\nRunning as service can be achieved via nssm.\r\n\r\n## Troubleshooting\r\n\r\nYou can enable debugging in order to have more info with\r\n```\r\nexport _DEBUG=true\r\n/usr/local/bin/nakivo_prometheus_exporter -c /etc/nakivo_prometheus.exporter.yaml\r\n```\r\n\r\n## Like it ?\r\n\r\nWrite us ;)\r\n",
    "bugtrack_url": null,
    "license": "GPLv3",
    "summary": "Connecto to Nakivo API and export metrics to Prometheus",
    "version": "0.2.3",
    "project_urls": {
        "Homepage": "https://github.com/netinvent/nakivo_prometheus_exporter"
    },
    "split_keywords": [
        "shell",
        " backup",
        " prometheus",
        " linux",
        " cli"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d4247122d5f2a0aa4898b572e27fca806ba1627cc080f9b1b975c38823ef7dbf",
                "md5": "8fd4e538e0fabafcf7c46dc9de3e36c4",
                "sha256": "3f1c3f1c425d6fa58613d5fbcd2455e9f5bd2a256a1401f970029463c8a9f77b"
            },
            "downloads": -1,
            "filename": "nakivo_prometheus_exporter-0.2.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8fd4e538e0fabafcf7c46dc9de3e36c4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 13373,
            "upload_time": "2024-04-16T13:23:10",
            "upload_time_iso_8601": "2024-04-16T13:23:10.279612Z",
            "url": "https://files.pythonhosted.org/packages/d4/24/7122d5f2a0aa4898b572e27fca806ba1627cc080f9b1b975c38823ef7dbf/nakivo_prometheus_exporter-0.2.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bd5dc8aa329043a1063db11c0a3d3f015d4f81a83134ab4aea4e5501181dbd95",
                "md5": "799dc64112b56ce939464261a322caa0",
                "sha256": "d91b9032b25662b823303bc77018acf68d9a4c22f6726814957c686da203183d"
            },
            "downloads": -1,
            "filename": "nakivo_prometheus_exporter-0.2.3.tar.gz",
            "has_sig": false,
            "md5_digest": "799dc64112b56ce939464261a322caa0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 12779,
            "upload_time": "2024-04-16T13:23:11",
            "upload_time_iso_8601": "2024-04-16T13:23:11.906342Z",
            "url": "https://files.pythonhosted.org/packages/bd/5d/c8aa329043a1063db11c0a3d3f015d4f81a83134ab4aea4e5501181dbd95/nakivo_prometheus_exporter-0.2.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-16 13:23:11",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "netinvent",
    "github_project": "nakivo_prometheus_exporter",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "ruamel.yaml",
            "specs": []
        },
        {
            "name": "ofunctions.requestor",
            "specs": [
                [
                    ">=",
                    "1.1.0"
                ]
            ]
        },
        {
            "name": "ofunctions.logger_utils",
            "specs": []
        },
        {
            "name": "ofunctions.logger_utils",
            "specs": [
                [
                    ">=",
                    "2.4.0"
                ]
            ]
        },
        {
            "name": "gunicorn",
            "specs": []
        },
        {
            "name": "uvicorn",
            "specs": []
        },
        {
            "name": "fastapi",
            "specs": []
        },
        {
            "name": "fastapi-offline",
            "specs": [
                [
                    ">=",
                    "1.5.0"
                ]
            ]
        },
        {
            "name": "pydantic",
            "specs": [
                [
                    "~=",
                    "2.6.3"
                ]
            ]
        }
    ],
    "lcname": "nakivo-prometheus-exporter"
}
        
Elapsed time: 0.31115s