Dnsmasq DHCP collector
Dnsmasq
is a lightweight, easy to configure, DNS forwarder and DHCP
server.
This module monitors Dnsmasq DHCP
leases database.
Metrics
All metrics have "dnsmasq_dhcp." prefix.
Labels per scope:
- dhcp range: dhcp_range.
Metric | Scope | Dimensions | Units |
---|---|---|---|
dhcp_ranges | global | ipv4, ipv6 | ranges |
dhcp_hosts | global | ipv4, ipv6 | hosts |
dhcp_range_utilization | dhcp range | used | percentage |
dhcp_range_allocated_leases | dhcp range | allocated | leases |
Auto-detection
Module automatically detects all configured dhcp-ranges reading dnsmasq
configuration files.
By default it uses:
/var/lib/misc/dnsmasq.leases
to read leases./etc/dnsmasq.conf
to detect dhcp-ranges./etc/dnsmasq.d
to find additional configurations.
Configuration
Edit the go.d/dnsmasq_dhcp.conf
configuration file using edit-config
from the
Netdata config directory, which is typically at /etc/netdata
.
cd /etc/netdata # Replace this path with your Netdata config directory
sudo ./edit-config go.d/dnsmasq_dhcp.conf
Here is an example:
jobs:
- name: dnsmasq_dhcp
leases_path: /var/lib/misc/dnsmasq.leases
conf_path: /etc/dnsmasq.conf
conf_dir: /etc/dnsmasq.d
For all available options please see module configuration file.
Troubleshooting
To troubleshoot issues with the dnsmasq_dhcp
collector, run the go.d.plugin
with the debug option enabled. The
output should give you clues as to why the collector isn't working.
Navigate to the
plugins.d
directory, usually at/usr/libexec/netdata/plugins.d/
. If that's not the case on your system, opennetdata.conf
and look for theplugins
setting under[directories]
.cd /usr/libexec/netdata/plugins.d/
Switch to the
netdata
user.sudo -u netdata -s
Run the
go.d.plugin
to debug the collector:./go.d.plugin -d -m dnsmasq_dhcp
Do you have any feedback for this page? If so, you can open a new issue on our netdata/learn repository.