prometheus mikrotik device(s) exporter
Go to file
Daniel Czerwonk d170b0a4d2 More features (#9)
* added config file implementation, refactoring
* add gitignore
* improved test
* preperations for more metrics
* added resource metrics
* added first bgp metrics
* added asn as label for bgp metrics
* added prefix and message counts to bgp metrics
* simplified
* Update README.md
* added yaml dependency
* fixed go routine call
* added timeout
* clean up
* added TLS support
* set default api port for TLS
* added routes metric
* added missing log information
* added type collectorContext to reduce the count of parameters for better readability
* added DHCP and DHCPv6 metrics
* filter for active dhcp leases only
* added pool metrics
* enable/disable feature in config file
* refactoring

* clean up

* comment fix
2018-04-11 09:21:38 -04:00
collector More features (#9) 2018-04-11 09:21:38 -04:00
config More features (#9) 2018-04-11 09:21:38 -04:00
examples/kubernetes/single-device more dev work (#1) 2017-09-16 22:38:01 -04:00
scripts squash merge from dev branch 2017-09-04 22:52:14 -04:00
vendor News features and improvements (#8) 2018-03-20 21:28:10 -04:00
.gitignore News features and improvements (#8) 2018-03-20 21:28:10 -04:00
Dockerfile squash merge from dev branch 2017-09-04 22:52:14 -04:00
Dockerfile.armhf squash merge from dev branch 2017-09-04 22:52:14 -04:00
Gopkg.lock News features and improvements (#8) 2018-03-20 21:28:10 -04:00
Gopkg.toml removed uber zap from vendor and switched to dep from glide (#6) 2017-11-29 22:48:49 -05:00
LICENSE adding in some files 2017-08-27 23:30:35 -04:00
MAINTAINERS.md clean up and adding in additional files 2017-10-12 08:36:20 -04:00
README.md More features (#9) 2018-04-11 09:21:38 -04:00
VERSION clean up and adding in additional files 2017-10-12 08:36:20 -04:00
main.go More features (#9) 2018-04-11 09:21:38 -04:00

README.md

Docker Pulls

prometheus-mikrotik

tl;dr - prometheus exporter for mikrotik devices

This is still a work in progress .. consider master at the moment as a preview release.

Description

A Prometheus Exporter for Mikrotik devices. Can be configured to collect metrics from a single device or multiple devices. Single device monitoring can be configured all on the command line. Multiple devices require a configuration file. A user will be required that has read-only access to the device configuration via the API.

Currently the exporter collects metrics for interfaces and system resources. Others can be added as long as published via the API.

Mikrotik Config

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

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

Create the user to access the API via.

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

Single Device

./mikrotik-exporter -address 10.10.0.1 -device my_router -password changeme -user prometheus

where address is the address of your router. device is the label name for the device in the metrics output to prometheus. The user and password are the ones you created for the exporter to use to access the API.

Config File

./mikrotik-exporter -config-file config.yml

where config-file is the path to a config file in YAML format.

example config
devices:
  - name: my_router
    address: 10.10.0.1
    user: prometheus
    password: changeme
  - name: my_second_router
    address: 10.10.0.2
    user: prometheus2
    password: password_to_second_router

features:
  bgp: true
  dhcp: true
  dhcpv6: true
  routes: true
  pools: true
example output
mikrotik_interface_tx_byte{address="10.10.0.1",interface="ether2",name="my_router"} 1.4189902583e+10
mikrotik_interface_tx_byte{address="10.10.0.1",interface="ether3",name="my_router"} 2.263768666e+09
mikrotik_interface_tx_byte{address="10.10.0.1",interface="ether4",name="my_router"} 1.6572299e+08
mikrotik_interface_tx_byte{address="10.10.0.1",interface="ether5",name="my_router"} 1.66711315e+08
mikrotik_interface_tx_byte{address="10.10.0.1",interface="ether6",name="my_router"} 1.0026481337e+10
mikrotik_interface_tx_byte{address="10.10.0.1",interface="ether7",name="my_router"} 3.18354425e+08
mikrotik_interface_tx_byte{address="10.10.0.1",interface="ether8",name="my_router"} 1.86405031e+08