Mercurial > code > home > repos > infra
diff templates/dnsmasq/metrics.mtail.j2 @ 119:51a471fa4d29
metrics on dnsmasq log errors and DHCP commands
author | drewp@bigasterisk.com |
---|---|
date | Wed, 07 Dec 2022 23:03:57 -0800 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/templates/dnsmasq/metrics.mtail.j2 Wed Dec 07 23:03:57 2022 -0800 @@ -0,0 +1,37 @@ +counter dnsmasq_no_addr_errors +/no address available/ { + dnsmasq_no_addr_errors++ +} + +counter dnsmasq_dhcp_requests +/DHCPREQUEST/ { + dnsmasq_dhcp_requests++ +} + +counter dnsmasq_dhcp_acks +/DHCPACK/ { + dnsmasq_dhcp_acks++ +} + +counter dnsmasq_dhcp_discovers +/DHCPDISCOVER/ { + dnsmasq_dhcp_discovers++ +} + +counter dnsmasq_dhcp_offers +/DHCPOFFER/ { + dnsmasq_dhcp_offers++ +} + +gauge dnsmasq_dns_queries_answered_locally +gauge dnsmasq_dns_queries_forwarded by server +gauge dnsmasq_dns_queries_retried_or_failed by server + +/queries forwarded (?P<fwd>\d+), queries answered locally (?P<loc>\d+)/ { + dnsmasq_dns_queries_answered_locally = $loc +} + +/server (?P<svr>\S+)#53: queries sent (?P<sent>\d+), retried or failed (?P<fail>\d+)/ { + dnsmasq_dns_queries_forwarded[$svr] = $sent + dnsmasq_dns_queries_retried_or_failed[$svr] = $fail +} \ No newline at end of file