A Prometheus exporter for Brother printers that collects metrics via SNMP.
Image: ghcr.io/d0ugal/brother-exporter:v1.12.42
brother_printer_info- Printer model, serial, firmware, and type information
brother_printer_connection_status- SNMP connection status (1 = connected, 0 = disconnected)brother_printer_connection_errors_total- Total connection errors by type
brother_printer_status- Printer operational status
brother_toner_level_percent- Toner level percentage by colorbrother_toner_status- Toner status (ok/low/empty) by colorbrother_drum_level_percent- Drum level percentage by colorbrother_drum_status- Drum status (ok/low/empty) by color
brother_ink_level_percent- Ink level percentage by colorbrother_ink_status- Ink status (ok/low/empty) by color
brother_paper_tray_status- Paper tray status by tray
brother_page_count_total- Total pages printedbrother_page_count_black_total- Black pages printedbrother_page_count_color_total- Color pages printed
GET /: HTML dashboard with service status and metrics informationGET /metrics: Prometheus metrics endpointGET /health: Health check endpoint
version: '3.8'
services:
brother-exporter:
image: ghcr.io/d0ugal/brother-exporter:v1.12.42
ports:
- "8080:8080"
environment:
- BROTHER_EXPORTER_PRINTER_HOST=192.168.1.100
- BROTHER_EXPORTER_PRINTER_TYPE=laser
- BROTHER_EXPORTER_PRINTER_COMMUNITY=public
restart: unless-stopped- Update the printer IP address in the environment variables
- Run:
docker-compose up -d - Access metrics:
curl http://localhost:8080/metrics
Create a config.yaml file to configure the printer connection:
server:
host: "0.0.0.0"
port: 8080
logging:
level: "info"
format: "json"
metrics:
collection:
default_interval: "30s"
printer:
host: "192.168.1.100" # Your Brother printer IP
community: "public" # SNMP community string
type: "laser" # "laser" or "ink"version: '3.8'
services:
brother-exporter:
image: ghcr.io/d0ugal/brother-exporter:v1.12.42
ports:
- "8080:8080"
environment:
- BROTHER_EXPORTER_PRINTER_HOST=192.168.1.100
- BROTHER_EXPORTER_PRINTER_TYPE=laser
- BROTHER_EXPORTER_PRINTER_COMMUNITY=public
restart: unless-stoppedapiVersion: apps/v1
kind: Deployment
metadata:
name: brother-exporter
spec:
replicas: 1
selector:
matchLabels:
app: brother-exporter
template:
metadata:
labels:
app: brother-exporter
spec:
containers:
- name: brother-exporter
image: ghcr.io/d0ugal/brother-exporter:v1.12.42
ports:
- containerPort: 8080
env:
- name: BROTHER_EXPORTER_PRINTER_HOST
value: "192.168.1.100"
- name: BROTHER_EXPORTER_PRINTER_TYPE
value: "laser"
- name: BROTHER_EXPORTER_PRINTER_COMMUNITY
value: "public"Add to your prometheus.yml:
scrape_configs:
- job_name: 'brother-exporter'
static_configs:
- targets: ['brother-exporter:8080']The Brother printer must have SNMP enabled with the following settings:
- SNMP Version: v2c (recommended) or v1
- Community String: Usually "public" (default)
- Port: 161 (default SNMP port)
- Access the printer's web interface
- Navigate to Network Settings → SNMP
- Enable SNMP
- Set the community string (default: "public")
- Save settings
make buildmake testmake lintmake fmt- Check SNMP is enabled on the printer
- Verify community string matches configuration
- Test SNMP connectivity:
snmpwalk -v2c -c public 192.168.1.100 1.3.6.1.2.1.1.1.0
- Check printer type configuration (laser vs ink)
- Verify OID support - some older printers may not support all OIDs
- Check logs for SNMP errors
This project is licensed under the MIT License.