Go to file
pSox 89deac379c update comments format 2022-11-18 09:08:01 +00:00
.github/workflows docker release: Add needed steps for build-push-action@v2 2021-01-08 08:59:12 +01:00
pkg update comments format 2022-11-18 09:08:01 +00:00
.gitignore update gitignore 2022-11-17 11:38:20 +00:00
Dockerfile Update map types 2022-11-17 13:59:06 +00:00
LICENSE initial commit2 2019-12-26 21:52:54 +01:00
README.md README: Add docker part and missing metrics in example 2021-01-11 09:39:11 +01:00
go.mod updated go-ipp module to get from stateless 2022-11-17 11:59:40 +00:00
go.sum updated go-ipp module to get from stateless 2022-11-17 11:59:40 +00:00
main.go update comments format 2022-11-18 09:08:01 +00:00

README.md

Prometheus CUPS Exporter

Prometheus exporter for CUPS server, forked from "phin1x/cups_exporter"

Running

Download the latest release and run the exporter locally :

$ ./cups_exporter
INFO	cups_exporter/main.go:30	starting cups exporter
INFO	cups_exporter/main.go:49	listening on :9628

The following arguments are supported :

$ ./cups_exporter -h
Usage of ./cups_exporter:
  -cups.uri string
    	uri under which the cups server is available, including username and password it required (default "https://localhost:631")
  -web.listen-address string
    	address on which to expose metrics and web interface (default ":9628")
  -web.telemetry-path string
    	path under which to expose metrics (default "/metrics")

With docker :

docker run -e CUPS_URI=https://cups.my ghcr.io/camptocamp/cups_exporter:0.0.8

Or if you want to test on your machine :

$ docker run --rm --network="host" ghcr.io/camptocamp/cups_exporter:0.0.8

Metrics

Metric Meaning Labels
cups_up Was the last scrape of cups successful
cups_job_state_total Number of current print jobs per state printer, state
cups_job_total Total number of print jobs per printer printer
cups_printer_state_total Number of printers per state printer, state
cups_printer_total Total number of available printers
cups_scrape_duration_seconds Duration of the last scrape in seconds

Examples:

# HELP cups_job_state_total Number of jobs per state
# TYPE cups_job_state_total gauge
cups_job_state_total{printer="CUPS_Printer_1",state="aborted"} 0
cups_job_state_total{printer="CUPS_Printer_1",state="canceled"} 0
cups_job_state_total{printer="CUPS_Printer_1",state="completed"} 2
cups_job_state_total{printer="CUPS_Printer_1",state="held"} 0
cups_job_state_total{printer="CUPS_Printer_1",state="pending"} 0
cups_job_state_total{printer="CUPS_Printer_1",state="processing"} 1
cups_job_state_total{printer="CUPS_Printer_1",state="stopped"} 0
# HELP cups_job_total Total number of print jobs
# TYPE cups_job_total counter
cups_job_total{printer="CUPS_Printer_1"} 3
# HELP cups_printer_state_total Number of printers per state
# TYPE cups_printer_state_total gauge
cups_printer_state_total{printer="CUPS_Printer_1",state="idle"} 1
cups_printer_state_total{printer="CUPS_Printer_1",state="processing"} 0
cups_printer_state_total{printer="CUPS_Printer_1",state="stopped"} 0
# HELP cups_printer_total Number of available printers
# TYPE cups_printer_total gauge
cups_printer_total 2
# HELP cups_scrape_duration_seconds Duration of the last scrape in seconds
# TYPE cups_scrape_duration_seconds gauge
cups_scrape_duration_seconds 0.036579092
# HELP cups_up Was the last scrape of cups successful
# TYPE cups_up gauge
cups_up 1

Licence

Apache Licence Version 2.0