github.com/netdata/go.d.plugin@v0.58.1/modules/dnsmasq_dhcp/integrations/dnsmasq_dhcp.md (about) 1 <!--startmeta 2 custom_edit_url: "https://github.com/netdata/go.d.plugin/edit/master/modules/dnsmasq_dhcp/README.md" 3 meta_yaml: "https://github.com/netdata/go.d.plugin/edit/master/modules/dnsmasq_dhcp/metadata.yaml" 4 sidebar_label: "Dnsmasq DHCP" 5 learn_status: "Published" 6 learn_rel_path: "Data Collection/DNS and DHCP Servers" 7 most_popular: False 8 message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE" 9 endmeta--> 10 11 # Dnsmasq DHCP 12 13 14 <img src="https://netdata.cloud/img/dnsmasq.svg" width="150"/> 15 16 17 Plugin: go.d.plugin 18 Module: dnsmasq_dhcp 19 20 <img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" /> 21 22 ## Overview 23 24 This collector monitors Dnsmasq DHCP leases databases, depending on your configuration. 25 26 By default, it uses: 27 28 - `/var/lib/misc/dnsmasq.leases` to read leases. 29 - `/etc/dnsmasq.conf` to detect dhcp-ranges. 30 - `/etc/dnsmasq.d` to find additional configurations. 31 32 33 34 35 This collector is supported on all platforms. 36 37 This collector only supports collecting metrics from a single instance of this integration. 38 39 40 ### Default Behavior 41 42 #### Auto-Detection 43 44 All configured dhcp-ranges are detected automatically 45 46 47 #### Limits 48 49 The default configuration for this integration does not impose any limits on data collection. 50 51 #### Performance Impact 52 53 The default configuration for this integration is not expected to impose a significant performance impact on the system. 54 55 56 ## Metrics 57 58 Metrics grouped by *scope*. 59 60 The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels. 61 62 63 64 ### Per Dnsmasq DHCP instance 65 66 These metrics refer to the entire monitored application. 67 68 This scope has no labels. 69 70 Metrics: 71 72 | Metric | Dimensions | Unit | 73 |:------|:----------|:----| 74 | dnsmasq_dhcp.dhcp_ranges | ipv4, ipv6 | ranges | 75 | dnsmasq_dhcp.dhcp_hosts | ipv4, ipv6 | hosts | 76 77 ### Per dhcp range 78 79 These metrics refer to the DHCP range. 80 81 Labels: 82 83 | Label | Description | 84 |:-----------|:----------------| 85 | dhcp_range | DHCP range in `START_IP:END_IP` format | 86 87 Metrics: 88 89 | Metric | Dimensions | Unit | 90 |:------|:----------|:----| 91 | dnsmasq_dhcp.dhcp_range_utilization | used | percentage | 92 | dnsmasq_dhcp.dhcp_range_allocated_leases | allocated | leases | 93 94 95 96 ## Alerts 97 98 99 The following alerts are available: 100 101 | Alert name | On metric | Description | 102 |:------------|:----------|:------------| 103 | [ dnsmasq_dhcp_dhcp_range_utilization ](https://github.com/netdata/netdata/blob/master/health/health.d/dnsmasq_dhcp.conf) | dnsmasq_dhcp.dhcp_range_utilization | DHCP range utilization | 104 105 106 ## Setup 107 108 ### Prerequisites 109 110 No action required. 111 112 ### Configuration 113 114 #### File 115 116 The configuration file name for this integration is `go.d/dnsmasq_dhcp.conf`. 117 118 119 You can edit the configuration file using the `edit-config` script from the 120 Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/configure/nodes.md#the-netdata-config-directory). 121 122 ```bash 123 cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata 124 sudo ./edit-config go.d/dnsmasq_dhcp.conf 125 ``` 126 #### Options 127 128 The following options can be defined globally: update_every, autodetection_retry. 129 130 131 <details><summary>Config options</summary> 132 133 | Name | Description | Default | Required | 134 |:----|:-----------|:-------|:--------:| 135 | update_every | Data collection frequency. | 1 | no | 136 | autodetection_retry | Recheck interval in seconds. Zero means no recheck will be scheduled. | 0 | no | 137 | leases_path | Path to dnsmasq DHCP leases file. | /var/lib/misc/dnsmasq.leases | no | 138 | conf_path | Path to dnsmasq configuration file. | /etc/dnsmasq.conf | no | 139 | conf_dir | Path to dnsmasq configuration directory. | /etc/dnsmasq.d,.dpkg-dist,.dpkg-old,.dpkg-new | no | 140 141 </details> 142 143 #### Examples 144 145 ##### Basic 146 147 An example configuration. 148 149 <details><summary>Config</summary> 150 151 ```yaml 152 jobs: 153 - name: dnsmasq_dhcp 154 leases_path: /var/lib/misc/dnsmasq.leases 155 conf_path: /etc/dnsmasq.conf 156 conf_dir: /etc/dnsmasq.d 157 158 ``` 159 </details> 160 161 ##### Pi-hole 162 163 Dnsmasq DHCP on Pi-hole. 164 165 <details><summary>Config</summary> 166 167 ```yaml 168 jobs: 169 - name: dnsmasq_dhcp 170 leases_path: /etc/pihole/dhcp.leases 171 conf_path: /etc/dnsmasq.conf 172 conf_dir: /etc/dnsmasq.d 173 174 ``` 175 </details> 176 177 178 179 ## Troubleshooting 180 181 ### Debug Mode 182 183 To troubleshoot issues with the `dnsmasq_dhcp` collector, run the `go.d.plugin` with the debug option enabled. The output 184 should give you clues as to why the collector isn't working. 185 186 - Navigate to the `plugins.d` directory, usually at `/usr/libexec/netdata/plugins.d/`. If that's not the case on 187 your system, open `netdata.conf` and look for the `plugins` setting under `[directories]`. 188 189 ```bash 190 cd /usr/libexec/netdata/plugins.d/ 191 ``` 192 193 - Switch to the `netdata` user. 194 195 ```bash 196 sudo -u netdata -s 197 ``` 198 199 - Run the `go.d.plugin` to debug the collector: 200 201 ```bash 202 ./go.d.plugin -d -m dnsmasq_dhcp 203 ``` 204 205