Skip to main content

Python Prometheus client to RouterBoard devices produced by MikroTik.

Project description

RouterOS Prometheus client

Description

Prometheus client for Mikrotik devices. Can be configured to collect metrics from a single device or multiple devices.

To access the api, use RouterOS-api.

To create metrics, use Prometheus Python Client.

Install

pip install routeros-prometheus-client

Usage

Mikrotik Config

Create a user on the device that has API and read-only access.

/user group add name=prometheus policy=api,read,winbox

Create the user to access the API via.

/user add name=prometheus group=prometheus password=changeme

Create config file

[my_router]
host = 192.168.1.1
username = login
password = password
plaintext_login = True

[my_second_router]
host = 192.168.1.2
username = login
password = password
plaintext_login = True
  • [section] - String - Used for identification device
  • host - String - Hostname or IP of device
  • username - String - Login username - Default 'admin'
  • password - String - Login password - Default empty string
  • port - Integer - TCP Port for API - Default 8728 or 8729 when using SSL
  • plaintext_login - Boolean - Try plaintext login (for RouterOS 6.43 onwards) - Default False
  • use_ssl - Boolean - Use SSL or not? - Default False
  • ssl_verify - Boolean - Verify the SSL certificate? - Default True
  • ssl_verify_hostname - Boolean - Verify the SSL certificate hostname matches? - Default True
  • ssl_context - Object - Pass in a custom SSL context object. Overrides other options. - Default None

Start routeros-prometheus-client

routeros-prometheus-client -c routeros-prometheus-client\config.ini -p 8000

  • -c --config path to config.ini
  • -p --port HTTPServer port

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

RouterOS-Prometheus-client-0.0.5.tar.gz (4.6 kB view details)

Uploaded Source

File details

Details for the file RouterOS-Prometheus-client-0.0.5.tar.gz.

File metadata

  • Download URL: RouterOS-Prometheus-client-0.0.5.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7

File hashes

Hashes for RouterOS-Prometheus-client-0.0.5.tar.gz
Algorithm Hash digest
SHA256 22df634377d3da7a24e17d30a67203bdf76ddcedb97dc81fded5d1a254be7e61
MD5 b51c809a7ebcfbb07a3104fb3d7bb4f7
BLAKE2b-256 ebc34686cc2a796404c7a5da039ed17846349513b6ff2770bce0894cc5a8fcd7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page