Can you monitor your ad blocker with Zabbix? Of course, you can!
Table of Contents
API defines it all
My home Asus router is running on Asuswrt-Merlin firmware, and with that, I have AdGuard Home ad blocker.
As AdGuard Home has an API, monitoring it with Zabbix is trivial.
![](https://blog.zabbix.com/wp-content/uploads/2023/11/1_AdGuard-dashboard-1024x602.png)
Communicate with the API
Communicating with AdGuard Home API is easy: pass it Authorisation: Basic XXXXXXXXXXXX header, where XXXXXXXXXX is just a Base64 hash of your AdGuard username and password. You can generate that Base64 snippet with for example
echo -n "myuser:mypassword" | base64
Next, in Zabbix, create a new HTTP Agent type item, and point it to your AdGuard Home instance.
![](https://blog.zabbix.com/wp-content/uploads/2023/11/2_Master-item-1024x281.png)
Create some items
You’ll get the info back as JSON, so next you can create some dependent items and start monitoring. I only added
- Total number of DNS requests
- Blocked # of DNS requests
- Redirects to safe search
- Parental advisory stuff
- Average request processing time
For the dependent items, you’ll then just do some JSONPath processing.
![](https://blog.zabbix.com/wp-content/uploads/2023/11/3_Preprocessing-1024x334.png)
Add triggers
Next, I added a few triggers to alert me if AdGuard starts to run slower than usual.
![](https://blog.zabbix.com/wp-content/uploads/2023/11/4_Triggers-1024x105.png)
Add service
Finally, I added AdGuard as a new business service, so I’ll get an SLA for it.
And that’s it! From now on I’ll know more about how well my home router ad-blocker is working. (Well, it also has a Skynet firewall which probably filters stuff before AdGuard Home, but that’s another story….)
This post was originally published on the author’s page.