nshttpd / mikrotik-exporter

prometheus mikrotik device(s) exporter
BSD 3-Clause "New" or "Revised" License
550 stars 153 forks source link

Cannot retrieve DHCP Leases #98

Open CPietro opened 3 years ago

CPietro commented 3 years ago

As the title says, I'm unable to retrieve DHCP Leases from my MikroTik RB4011. I'm running the script on Ubuntu 20.04, and followed this guide for the installation. For example, when doing curl localhost:9436/metrics, only some stuff is displayed, such as some system stats and interfaces tx/rx data. This is my yaml file:

devices:
  - name: Mikrotik
    address: 10.0.10.1
    user: prometheus
    password: xxxxxxxxxxxxx

features:
  bgp: true
  dhcp: true
  dhcpv6: true
  dhcpl: true
  routes: true
  pools: true
  optics: true
  ipsec: true
nshttpd commented 3 years ago

Are you getting an error message reported by the exporter?

merlinios commented 3 years ago

Same problem with my configuration . DHCP leases is empty . No errors

nshttpd commented 3 years ago

What device and OS version? Building from master I get :

# TYPE mikrotik_dhcp_leases_active_count gauge
mikrotik_dhcp_leases_active_count{address="x.x.x.x",name="router",server="default"} 72
mikrotik_dhcp_leases_active_count{address="x.x.x.x",name="router",server="dhcp1"} 0

when I curl against it.

nshttpd commented 3 years ago

Do you have IPV6 configured and running? If not and you turn off dhcpv6 to false does it work?

kadet77rus commented 2 years ago

I have the same problem

curl 10.240.43.56:9436/metrics | grep uptime
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 22162  100 22162    0     0   569k      0 --:--:-- --:--:-- --:--:--  584k
# HELP mikrotik_system_uptime uptime
# TYPE mikrotik_system_uptime counter
mikrotik_system_uptime{address="10.240.43.1",boardname="RB1100AHx4",name="MikroTik",version="6.49 (stable)"} 2.155016e+06
curl 10.240.43.56:9436/metrics | grep dhcp
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 22163  100 22163    0     0   636k      0 --:--:-- --:--:-- --:--:--  636k
udenBrus commented 2 years ago

Same here CRS305 V6.49.2