返回更新列表
新发布Sep 3, 2026

suricata_exporter v0.6.0

用于 Suricata 的 Prometheus Exporter

分享

Suricata Prometheus Exporter

这是一个用于 Suricata 的 Prometheus Exporter,通过 unix socket 使用 dump-counters 来查询指标。

使用方法

$ ./suricata_exporter -h
Usage of ./suricata_exporter:
  -suricata.socket-path string
        Path to the Suricata Command socket. (default "/var/run/suricata.socket")
  -version
        Output version information.
  -web.listen-address string
        Address to listen on (default ":9917")
  -quiet
        supress logging messages when suricata is not enabled
  -totals
        Export only the overall global total metrics instead of per-thread metrics. (default false)

要验证 Exporter 是否能与你的 Suricata 环境正常工作,请使用以下命令查看一部分捕获指标。

$ curl -s localhost:9917/metrics | grep kernel_packets_total
# HELP suricata_capture_kernel_packets_total
# TYPE suricata_capture_kernel_packets_total counter
suricata_capture_kernel_packets_total{thread="W#01-eth1"} 7744
suricata_capture_kernel_packets_total{thread="W#02-eth1"} 8435
suricata_capture_kernel_packets_total{thread="W#03-eth1"} 7564
suricata_capture_kernel_packets_total{thread="W#04-eth1"} 9747

现在,你可以配置一个 Prometheus 服务器 定期抓取 Suricata Exporter 的数据,以便后续进行可视化和分析。

指标

目前会为 decoderflowflow_bypassedapp_layertcp 生成每线程指标。memuse 指标则按全局报告。

兼容性

基于 Suricata 6.0.4 和 af-packet 开发。大多数受支持的指标均为硬编码。

已针对 Suricata 7.0.0 进行更新,但并非所有新增指标都已添加。

分类