Skip to content

Latest commit

 

History

History
122 lines (97 loc) · 4 KB

README.md

File metadata and controls

122 lines (97 loc) · 4 KB

Logo

ClamAV Prometheus Exporter

Go Report Card Apache V2 License

Exports metrics from ClamAV as Prometheus metrics.

Currently exposed metrics

  • ClamAVBuildInfo
  • ClamAVDatabaseAge
  • ClamAVMemHeap
  • ClamAVMemMmap
  • ClamAVMemUsed
  • ClamAVPoolsTotal
  • ClamAVPoolsUsed
  • ClamAVQueue
  • ClamAVThreadsIdle
  • ClamAVThreadsLive
  • ClamAVThreadsMax
  • ClamAVUp
# HELP clamav_build_info Shows ClamAV Build Info
# TYPE clamav_build_info gauge
clamav_build_info{clamav_version="0.102.4",database_version="26091"} 1
# HELP clamav_database_age Shows ClamAV signature database age in seconds
# TYPE clamav_database_age gauge
clamav_database_age 447408.4671055
# HELP clamav_mem_heap_bytes Shows heap memory usage in bytes
# TYPE clamav_mem_heap_bytes gauge
clamav_mem_heap_bytes 1.090783104e+06
# HELP clamav_mem_mmap_bytes Shows mmap memory usage in bytes
# TYPE clamav_mem_mmap_bytes gauge
clamav_mem_mmap_bytes 1.076747264e+06
# HELP clamav_mem_used_bytes Shows used memory in bytes
# TYPE clamav_mem_used_bytes gauge
clamav_mem_used_bytes 1.076783104e+06
# HELP clamav_pools_total_bytes Shows total memory allocated by memory pool allocator for the signature database in bytes
# TYPE clamav_pools_total_bytes gauge
clamav_pools_total_bytes 1.076783104e+06
# HELP clamav_pools_used_bytes Shows memory used by memory pool allocator for the signature database in bytes
# TYPE clamav_pools_used_bytes gauge
clamav_pools_used_bytes 1.076747264e+06
# HELP clamav_queue_length Shows queued items
# TYPE clamav_queue_length gauge
clamav_queue_length 0
# HELP clamav_threads_idle Shows idle threads
# TYPE clamav_threads_idle gauge
clamav_threads_idle 0
# HELP clamav_threads_live Shows live threads
# TYPE clamav_threads_live gauge
clamav_threads_live 1
# HELP clamav_threads_max Shows max threads
# TYPE clamav_threads_max gauge
clamav_threads_max 10
# HELP clamav_up Shows UP Status
# TYPE clamav_up gauge
clamav_up 1

Installation

ClamAV Prometheus Exporter requires a supported release of Go.

$ go get -u github.com/r3kzi/clamav-prometheus-exporter

To find out where clamav-prometheus-exporter was installed you can run $ go list -f {{.Target}} github.com/r3kzi/clamav-prometheus-exporter.

For clamav-prometheus-exporter to be used globally add that directory to the $PATH environment setting.

You could also build the binary yourself running:

$ make build

Flags

ClamAV server to connect to:

Usage of clamav-prometheus-exporter:
  -clamav-address string
      ClamAV address to use (default "localhost")
  -clamav-port int
      ClamAV port to use (default 3310)
  -log-level string
      Set the level of logging. (options: trace, debug, info, warn, error, fatal, panic) (default "info")
  -network string
      Network mode to use, typically tcp or unix (socket) (default "tcp")

Prometheus config

Just scrape this, e.g.:

scrape_configs:
  - job_name: 'clamav-prometheus-exporter'
    static_configs:
      - targets: ['localhost:9810']

Release

Versions are released following semantic versioning pattern.

For a new version to be generated, a Release and Tag must be created in the repository following the pattern: v.X.Y.Z.

This will trigger a GitHub Action and make a new image available on DockerHub, where the tag pattern will be: rekzi/clamav-prometheus-exporter:X.Y.Z.

Contributing

Pull requests are welcome.