mikrotik-exporter icon indicating copy to clipboard operation
mikrotik-exporter copied to clipboard

Cannot retrieve DHCP Leases

Open CPietro opened this issue 4 years ago • 6 comments

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

CPietro avatar Nov 20 '20 14:11 CPietro

Are you getting an error message reported by the exporter?

nshttpd avatar Mar 23 '21 02:03 nshttpd

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

merlinios avatar Apr 20 '21 15:04 merlinios

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 avatar Apr 23 '21 01:04 nshttpd

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

nshttpd avatar Apr 23 '21 01:04 nshttpd

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

kadet77rus avatar Jan 11 '22 08:01 kadet77rus

Same here CRS305 V6.49.2

udenBrus avatar Jul 07 '22 16:07 udenBrus