Caddy monitoring with Zabbix
Caddy monitoring with Zabbix
There is a way to monitor Caddy with Prometheus, but my setup is using Zabbix and I could not find a ready made template for Caddy, so I made one. The template uses HTTP agent to get the data from exposed Caddy metrics.
Enable Caddy metrics
Enable metrics in Caddyfile and expose them on port 8080 on the /metrics path:
When exposing metrics on a different port, make sure that port is exposed also in docker container.
1
2
3
4
5
6
7
8
9
{
servers {
metrics
}
}
:8080 {
metrics /metrics
}
Zabbix
Created on Zabbix ver. 7.2
Import template
Download the template file zabbix-caddy.yaml from my Github repo.
Navigate to Data collection -> Templates and click Import in top right corner in Zabbix.
Choose the downloaded file to import and click Import.
Using template
There are three macros to set up the template:
{$CADDY.HOST}- default: 127.0.0.1{$CADDY.PATH}- default: /metrics{$CADDY.PORT}- default: 8080

This post is licensed under CC BY 4.0 by the author.