
sysadminliip/clamav-prometheus-exporterClamAV Prometheus Exporter是一个轻量级工具,用于将ClamAV防病毒引擎的运行指标导出为Prometheus可抓取的格式。通过该工具,用户可以轻松监控ClamAV的各种关键性能指标,如扫描文件数量、检测到的病毒数量、扫描速度以及病毒库更新状态等。
基本运行命令:
bashdocker run -d \ --name clamav-exporter \ -p 9726:9726 \ -e CLAMAV_HOST=clamav \ -e CLAMAV_PORT=3310 \ liip/clamav-prometheus-exporter
自定义收集间隔(默认为30秒):
bashdocker run -d \ --name clamav-exporter \ -p 9726:9726 \ -e CLAMAV_HOST=clamav \ -e CLAMAV_PORT=3310 \ -e SCRAPE_INTERVAL=60 \ liip/clamav-prometheus-exporter
yamlversion: '3' services: clamav: image: clamav/clamav ports: - "3310:3310" volumes: - clamav_data:/var/lib/clamav restart: always clamav-exporter: image: liip/clamav-prometheus-exporter ports: - "9726:9726" environment: - CLAMAV_HOST=clamav - CLAMAV_PORT=3310 - SCRAPE_INTERVAL=30 depends_on: - clamav restart: always prometheus: image: prom/prometheus volumes: - ./prometheus.yml:/etc/prometheus/prometheus.yml ports: - "9090:9090" depends_on: - clamav-exporter restart: always volumes: clamav_data:
| 环境变量 | 描述 | 默认值 |
|---|---|---|
CLAMAV_HOST | ClamAV服务器主机名或IP地址 | localhost |
CLAMAV_PORT | ClamAV服务器端口 | 3310 |
LISTEN_PORT | Exporter监听端口 | 9726 |
SCRAPE_INTERVAL | 指标收集间隔(秒) | 30 |
LOG_LEVEL | 日志级别(debug, info, warn, error) | info |
METRICS_PATH | Prometheus指标路径 | /metrics |
| 指标名称 | 描述 | 类型 |
|---|---|---|
clamav_up | ClamAV连接状态(1=连接正常,0=连接失败) | Gauge |
clamav_scanned_files_total | 总扫描文件数 | Counter |
clamav_scanned_bytes_total | 总扫描字节数 | Counter |
clamav_infected_files_total | 总感染文件数 | Counter |
clamav_scan_time_seconds_total | 总扫描时间(秒) | Counter |
clamav_db_version | 病毒库版本 | Gauge |
clamav_db_last_updated_timestamp | 病毒库最后更新时间戳 | Gauge |
clamav_scan_speed_bytes_per_second | 扫描速度(字节/秒) | Gauge |
在Prometheus配置文件中添加以下job:
yamlscrape_configs: - job_name: 'clamav' static_configs: - targets: ['clamav-exporter:9726']



探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
无需登录使用专属域名
Kubernetes 集群配置 Containerd
K3s 轻量级 Kubernetes 镜像加速
VS Code Dev Containers 配置
Podman 容器引擎配置
HPC 科学计算容器配置
ghcr、Quay、nvcr 等镜像仓库
Harbor Proxy Repository 对接专属域名
Portainer Registries 加速拉取
Nexus3 Docker Proxy 内网缓存
需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单
manifest unknown
no matching manifest(架构)
invalid tar header(解压)
TLS 证书失败
DNS 超时
410 Gone 排查
402 与流量用尽
401 认证失败
429 限流
D-Bus 凭证提示
413 与超大单层
来自真实用户的反馈,见证轩辕镜像的优质服务