GithubHelp home page GithubHelp logo

rekup / netbox-prometheus-sd Goto Github PK

View Code? Open in Web Editor NEW

This project forked from flxpeters/netbox-prometheus-sd

0.0 0.0 0.0 155 KB

Service discovery for VMs and Devices in Netbox

License: MIT License

Dockerfile 15.66% Python 84.34%

netbox-prometheus-sd's Introduction

Netbox Prometheus SD

License: MIT CI Maintainability Rating Dockerhub

File based service discovery script for Prometheus. Make virtual machines and devices managed in Netbox as Prometheus targets with labels.

Roadmap to 0.1

  • Add build process for tagged Docker builds
  • Add better unit tests

Requirement

Config

The app is configured with env variables.

NETBOX_SD_URL: https://netboxdemo.com
NETBOX_SD_TOKEN:  72830d67beff4ae178b94d8f781842408df8069d
NETBOX_FILTER: "{\"status\":\"active\",\"site\":\"ds9\"}"
NETBOX_SD_FILE_PATH: /data/netbox/netbox.json
NETBOX_SD_LOG_LEVEL: "DEBUG"
NETBOX_SD_VERIFY_SSL: "FALSE"

Filters are applied as JSON which is mapped to Netbox filter criterias.
See the Netbox for more Details: https://netbox.readthedocs.io/en/stable/rest-api/filtering/

Usage

python3 netbox-prometheus-sd.py

The service discovery script requires the URL to the Netbox instance, an API token that can be generated into the user profile page of Netbox and a path to an output file.

In the Prometheus configuration, declare a new scrape job using the file_sd_configs service discovery:

- job_name: 'netbox'
  file_sd_configs:
  - files:
    - '/path/to/my/output.json'

Example

See example directory for an example on how this service discovery. Currently we use netboxdemo.com for this. This should be changed to a local Docker based Netbox stack.

Thanks & Credits

This project is based on a Script from ENIX SAS:

netbox-prometheus-sd's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.