Profiles gain category/label/of/display/scale_by/sentinels/enum_state and component_attrs;
every pollable non-interface metric is annotated and an orphan test enforces it. New routes
GET /devices/{slug}/metrics, /metrics/graph and /printers; printer supply type/colour read at
discovery into device_components.attrs; printer_supply_empty alert; supply_replaced audit event;
docs/coverage.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lx9FNLG2CqeBbVGGd9bFsP
63 lines
4.4 KiB
YAML
63 lines
4.4 KiB
YAML
# Provenance: mibs/Printer-MIB (RFC 3805): prtMarkerSuppliesTable (1.3.6.1.2.1.43.11.1.1:
|
|
# Description .6, MaxCapacity .8, Level .9), prtMarkerTable LifeCount
|
|
# (1.3.6.1.2.1.43.10.2.1.4) and prtAlertTable SeverityLevel
|
|
# (1.3.6.1.2.1.43.18.1.1.2). Printer-MIB cannot be probed before discovery, so
|
|
# the profile matches common printer vendors' enterprise OIDs (HP JetDirect
|
|
# 11.2.3.9, Brother 2435, Xerox 253, Canon 1602, Lexmark 641, Kyocera 1347,
|
|
# Ricoh 367, Epson 1248; IANA enterprise numbers) or a printer-like sysDescr.
|
|
# Supply levels use -1 (other), -2 (unknown) and -3 (some remaining) as
|
|
# non-numeric markers: -1 is dropped; -2 and -3 are stored and shown as words (sentinels).
|
|
# Supply type and colorant are read at discovery as component attributes
|
|
# (prtMarkerSuppliesType, prtMarkerColorantValue joined through
|
|
# prtMarkerSuppliesColorantIndex) so the UI can colour a supply without polling it. A metric whose index_label column is
|
|
# its own name (prtMarkerLifeCount, prtAlertSeverityLevel) is labelled with the
|
|
# row index itself, since those tables have no description column.
|
|
name: printer
|
|
extends: generic
|
|
priority: 5
|
|
provenance: Printer-MIB (RFC 3805); IANA enterprise numbers for vendor matching
|
|
match:
|
|
sysObjectID:
|
|
- 1.3.6.1.4.1.11.2.3.9
|
|
- 1.3.6.1.4.1.2435
|
|
- 1.3.6.1.4.1.253
|
|
- 1.3.6.1.4.1.1602
|
|
- 1.3.6.1.4.1.641
|
|
- 1.3.6.1.4.1.1347
|
|
- 1.3.6.1.4.1.367
|
|
- 1.3.6.1.4.1.1248
|
|
sysDescr: '(?i)(laserjet|officejet|designjet|printer|bizhub|imagerunner|workcentre|ecosys|jetdirect)'
|
|
component_attrs:
|
|
- table: "Printer-MIB::prtMarkerSuppliesTable"
|
|
name: type
|
|
oid: 1.3.6.1.2.1.43.11.1.1.5
|
|
enum: { 1: other, 2: unknown, 3: toner, 4: wasteToner, 5: ink, 6: inkCartridge, 7: inkRibbon, 8: wasteInk, 9: opc, 10: developer, 11: fuserOil, 12: solidWax, 13: ribbonWax, 14: wasteWax, 15: fuser, 16: coronaWire, 17: fuserOilWick, 18: cleanerUnit, 19: fuserCleaningPad, 20: transferUnit, 21: tonerCartridge, 22: fuserOiler }
|
|
- table: "Printer-MIB::prtMarkerSuppliesTable"
|
|
name: color
|
|
oid: 1.3.6.1.2.1.43.12.1.1.4
|
|
join: 1.3.6.1.2.1.43.11.1.1.3
|
|
metrics:
|
|
- { name: prtMarkerSuppliesDescription, oid: 1.3.6.1.2.1.43.11.1.1.6, type: text, unit: text, interval: 15m }
|
|
- { name: prtMarkerSuppliesLevel, oid: 1.3.6.1.2.1.43.11.1.1.9, type: gauge, unit: count, interval: 15m, index_label: { column: prtMarkerSuppliesDescription, as: component }, table: "Printer-MIB::prtMarkerSuppliesTable", not_available: [-1], category: printer, label: "Supply level", of: prtMarkerSuppliesMaxCapacity, sentinels: { -3: "some remaining", -2: "unknown" } }
|
|
- { name: prtMarkerSuppliesMaxCapacity, oid: 1.3.6.1.2.1.43.11.1.1.8, type: gauge, unit: count, interval: 15m, index_label: { column: prtMarkerSuppliesDescription, as: component }, table: "Printer-MIB::prtMarkerSuppliesTable", not_available: [-1, -2], category: printer, label: "Supply capacity" }
|
|
- { name: prtMarkerLifeCount, oid: 1.3.6.1.2.1.43.10.2.1.4, type: counter32, unit: count, interval: 15m, index_label: { column: prtMarkerLifeCount, as: component }, table: "Printer-MIB::prtMarkerTable", category: printer, label: "Pages printed", display: gauge }
|
|
- name: prtAlertSeverityLevel
|
|
oid: 1.3.6.1.2.1.43.18.1.1.2
|
|
type: status
|
|
unit: enum
|
|
interval: 15m
|
|
index_label: { column: prtAlertSeverityLevel, as: component }
|
|
table: Printer-MIB::prtAlertTable
|
|
enum: { 1: other, 3: critical, 4: warning, 5: warningBinaryChangeEvent }
|
|
category: printer
|
|
label: "Alert severity"
|
|
enum_state: { other: unknown, critical: crit, warning: warn, warningBinaryChangeEvent: warn }
|
|
- { name: prtInputName, oid: 1.3.6.1.2.1.43.8.2.1.13, type: text, unit: text, interval: 15m }
|
|
- { name: prtInputCurrentLevel, oid: 1.3.6.1.2.1.43.8.2.1.10, type: gauge, unit: count, interval: 15m, index_label: { column: prtInputName, as: component }, table: "Printer-MIB::prtInputTable", not_available: [-1], category: printer, label: "Paper tray level", of: prtInputMaxCapacity, sentinels: { -3: "some remaining", -2: "unknown" } }
|
|
- { name: prtInputMaxCapacity, oid: 1.3.6.1.2.1.43.8.2.1.9, type: gauge, unit: count, interval: 15m, index_label: { column: prtInputName, as: component }, table: "Printer-MIB::prtInputTable", not_available: [-1, -2], category: printer, label: "Paper tray capacity" }
|
|
discovery_tables:
|
|
- Printer-MIB::prtMarkerSuppliesTable
|
|
- Printer-MIB::prtMarkerTable
|
|
- Printer-MIB::prtAlertTable
|
|
- Printer-MIB::prtInputTable
|