From 0d898e29bb3496f5ecbdc081dc2dacb9e24668cb Mon Sep 17 00:00:00 2001 From: DasSkelett Date: Wed, 18 Sep 2024 21:52:59 +0200 Subject: [PATCH] Improve Influx data format for dhcpd leases --- telegraf/files/in_dhcpd-pool.conf | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/telegraf/files/in_dhcpd-pool.conf b/telegraf/files/in_dhcpd-pool.conf index 2ffa0f9f..f7447d7b 100644 --- a/telegraf/files/in_dhcpd-pool.conf +++ b/telegraf/files/in_dhcpd-pool.conf @@ -3,5 +3,31 @@ "/usr/bin/dhcpd-pools -c /etc/dhcp/dhcpd.conf --format=j", ] timeout = "5s" - name_suffix = "_exec" + name_override = "dhcpd_pools_shared_networks" data_format = "json" + json_query = "shared-networks" + tag_keys = [ + "location", + ] + +[[inputs.exec]] + commands = [ + "/usr/bin/dhcpd-pools -c /etc/dhcp/dhcpd.conf --format=j", + ] + timeout = "5s" + name_override = "dhcpd_pools_subnets" + data_format = "json" + json_query = "subnets" + tag_keys = [ + "location", + "range", + ] + +[[inputs.exec]] + commands = [ + "/usr/bin/dhcpd-pools -c /etc/dhcp/dhcpd.conf --format=j", + ] + timeout = "5s" + name_override = "dhcpd_pools_summary" + data_format = "json" + json_query = "summary"