2019-12-26 20:52:54 +00:00
|
|
|
# Prometheus CUPS Exporter
|
|
|
|
|
2021-01-07 10:48:53 +00:00
|
|
|
Prometheus exporter for CUPS server, forked from ["phin1x/cups_exporter"](https://github.com/phin1x/cups_exporter)
|
2019-12-26 20:52:54 +00:00
|
|
|
|
2021-01-07 10:48:53 +00:00
|
|
|
# Running
|
2019-12-26 20:52:54 +00:00
|
|
|
|
2021-01-11 08:39:11 +00:00
|
|
|
### Download the latest release and run the exporter locally :
|
2019-12-26 20:52:54 +00:00
|
|
|
|
|
|
|
```bash
|
2021-01-07 10:48:53 +00:00
|
|
|
$ ./cups_exporter
|
|
|
|
INFO cups_exporter/main.go:30 starting cups exporter
|
|
|
|
INFO cups_exporter/main.go:49 listening on :9628
|
2019-12-26 20:52:54 +00:00
|
|
|
```
|
|
|
|
|
2021-01-07 10:48:53 +00:00
|
|
|
The following arguments are supported :
|
2019-12-26 20:52:54 +00:00
|
|
|
```bash
|
2021-01-07 10:48:53 +00:00
|
|
|
$ ./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")
|
2019-12-26 20:52:54 +00:00
|
|
|
```
|
|
|
|
|
2021-01-11 08:39:11 +00:00
|
|
|
### With docker :
|
|
|
|
|
|
|
|
```bash
|
|
|
|
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 :
|
|
|
|
|
|
|
|
```bash
|
|
|
|
$ docker run --rm --network="host" ghcr.io/camptocamp/cups_exporter:0.0.8
|
|
|
|
```
|
2021-01-07 10:48:53 +00:00
|
|
|
|
2019-12-26 20:52:54 +00:00
|
|
|
# Metrics
|
|
|
|
|
|
|
|
| Metric | Meaning | Labels |
|
|
|
|
| ------ | ------- | ------ |
|
2021-01-07 10:48:53 +00:00
|
|
|
| cups_up | Was the last scrape of cups successful | |
|
2021-01-11 08:39:11 +00:00
|
|
|
| cups_job_state_total | Number of current print jobs per state | printer, state |
|
2021-01-07 10:48:53 +00:00
|
|
|
| cups_job_total | Total number of print jobs per printer | printer |
|
2021-01-11 08:39:11 +00:00
|
|
|
| cups_printer_state_total | Number of printers per state | printer, state |
|
2021-01-07 10:48:53 +00:00
|
|
|
| cups_printer_total | Total number of available printers | |
|
2019-12-26 20:52:54 +00:00
|
|
|
| cups_scrape_duration_seconds | Duration of the last scrape in seconds | |
|
|
|
|
|
2021-01-07 10:48:53 +00:00
|
|
|
|
|
|
|
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
|
2021-01-11 08:39:11 +00:00
|
|
|
# HELP cups_printer_state_total Number of printers per state
|
2021-01-07 10:48:53 +00:00
|
|
|
# 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
|
2021-01-11 08:39:11 +00:00
|
|
|
# HELP cups_printer_total Number of available printers
|
2021-01-07 10:48:53 +00:00
|
|
|
# TYPE cups_printer_total gauge
|
|
|
|
cups_printer_total 2
|
2021-01-11 08:39:11 +00:00
|
|
|
# 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
|
2021-01-07 10:48:53 +00:00
|
|
|
```
|
|
|
|
|
2019-12-26 20:52:54 +00:00
|
|
|
# Licence
|
|
|
|
|
|
|
|
Apache Licence Version 2.0
|