summaryrefslogtreecommitdiffstats
path: root/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/init.go
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/init.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/init.go b/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/init.go
new file mode 100644
index 000000000..6c74674a3
--- /dev/null
+++ b/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/init.go
@@ -0,0 +1,21 @@
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+package dnsmasq_dhcp
+
+import "errors"
+
+func (d *DnsmasqDHCP) validateConfig() error {
+ if d.LeasesPath == "" {
+ return errors.New("empty 'leases_path'")
+ }
+ return nil
+}
+
+func (d *DnsmasqDHCP) checkLeasesPath() error {
+ f, err := openFile(d.LeasesPath)
+ if err != nil {
+ return err
+ }
+ _ = f.Close()
+ return nil
+}