Initial commit: SNMP scanner and Zabbix template generator

Tools for printer discovery and monitoring:
- snmp_scanner.py: SNMP-based printer discovery
- generate_printer_templates.py: Generate Zabbix templates
- analyze_supplies.py: Analyze printer supply levels
- extract_summary.py: Extract printer data summaries

Includes Zabbix templates for:
- HP Color/Mono printers
- HP DesignJet T1700
- Xerox Color/Mono/Enterprise printers

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
cproudlock
2025-12-17 13:52:21 -05:00
commit 389e620261
30 changed files with 18489 additions and 0 deletions

View File

@@ -0,0 +1,407 @@
zabbix_export:
version: '7.4'
template_groups:
- uuid: 3cd4e8d0b828464e8f4b3becf13a9dbd
name: Printers
templates:
- uuid: cc0010f556eb4cb2bad376dcc3a9ad48
template: HP DesignJet T1700
name: HP DesignJet T1700
description: 'HP DesignJet T1700/T1700dr PostScript Large Format Printer (44" wide) with 6-color ink system.
Uses HP-specific OIDs for ink levels (1.3.6.1.4.1.11.2.3.9.4.2.1.4.1.5.4.X.1.0)
Correct HP 730 300ml cartridge mapping (verified from actual installation):
- P2V68A = Cyan
- P2V69A = Magenta
- P2V70A = Yellow
- P2V71A = Matte Black
- P2V72A = Gray
- P2V73A = Photo Black'
groups:
- name: Printers
items:
- uuid: 28f681e3fa0c4dd1a770bd84f537c01f
name: Printer Model
type: SNMP_AGENT
snmp_oid: 1.3.6.1.2.1.25.3.2.1.3.1
key: printer.model
delay: 1h
history: 90d
trends: 0d
value_type: TEXT
description: Printer Model
preprocessing: &id001
- type: JAVASCRIPT
parameters:
- "// Handle hex-encoded SNMP strings\n// Try multiple approaches to convert hex to ASCII\n\n// First, check if it looks like hex (with spaces, newlines, or other separators)\nvar hexPattern = /^[0-9A-Fa-f\\s]+$/;\nif (hexPattern.test(value) && value.length > 4) {\n // Extract all hex pairs (2 characters)\n var hexBytes = value.match(/[0-9A-Fa-f]{2}/g);\n if (hexBytes && hexBytes.length > 0) {\n var result = '';\n for (var i = 0; i < hexBytes.length; i++) {\n var code = parseInt(hexBytes[i], 16);\n // Only keep printable ASCII (0x20-0x7E)\n if (code >= 32 && code <= 126) {\n result += String.fromCharCode(code);\n }\n }\n if (result.length > 0) {\n return result;\n }\n }\n}\n\n// Fallback: Remove non-printable characters\nreturn value.replace(/[^\\x20-\\x7E]/g, '');"
tags:
- tag: component
value: printer
- tag: type
value: info
- uuid: 24c3f04df954430d9afa4af057edf563
name: Printer Hostname
type: SNMP_AGENT
snmp_oid: 1.3.6.1.2.1.1.5.0
key: printer.hostname
delay: 1h
history: 90d
trends: 0d
value_type: TEXT
description: Printer Hostname
preprocessing: *id001
tags:
- tag: component
value: printer
- tag: type
value: info
- uuid: 92c3223b193546b89d43ab18e831e518
name: Printer Serial Number
type: SNMP_AGENT
snmp_oid: 1.3.6.1.4.1.11.2.3.9.4.2.1.1.3.3.0
key: printer.serial
delay: 1h
history: 90d
trends: 0d
value_type: TEXT
description: Printer Serial Number (HP-specific OID)
preprocessing: *id001
tags:
- tag: component
value: printer
- tag: type
value: info
- uuid: 42c7f27d030b4498a083bd9837dadf28
name: System Location
type: SNMP_AGENT
snmp_oid: 1.3.6.1.2.1.1.6.0
key: printer.location
delay: 1h
history: 90d
trends: 0d
value_type: TEXT
description: System Location
preprocessing: *id001
tags:
- tag: component
value: printer
- tag: type
value: info
- uuid: 31edf9cd21fb444a8df1ca6d8f3208ac
name: Firmware Version
type: SNMP_AGENT
snmp_oid: 1.3.6.1.4.1.11.2.3.9.4.2.1.1.3.6.0
key: printer.firmware
delay: 1h
history: 90d
trends: 0d
value_type: TEXT
description: Printer Firmware Version
preprocessing: *id001
tags:
- tag: component
value: printer
- tag: type
value: info
- uuid: edb403c646ac4b80af0473dce49569e3
name: Matte Black Ink Part Number
type: SNMP_AGENT
snmp_oid: 1.3.6.1.2.1.43.11.1.1.6.1.3
key: printer.cartridge.matte_black
delay: 1h
history: 90d
trends: 0d
value_type: TEXT
description: Matte Black Ink Cartridge Part Number (HP 730 P2V71A)
preprocessing: *id001
tags:
- tag: component
value: supplies
- tag: type
value: info
- uuid: b59e604c50684e1a93b42e2c5ff9193b
name: Matte Black Ink Level
type: SNMP_AGENT
snmp_oid: 1.3.6.1.4.1.11.2.3.9.4.2.1.4.1.5.4.3.1.0
key: printer.ink.matte_black
delay: 1h
history: 90d
trends: 365d
value_type: FLOAT
units: '%'
description: Matte Black Ink Level Percentage (HP proprietary OID)
tags:
- tag: component
value: supplies
- tag: type
value: level
- tag: color
value: matte_black
triggers:
- uuid: 11a36271e33b464590c4004f14779875
expression: last(/HP DesignJet T1700/printer.ink.matte_black)<20 and length(last(/HP DesignJet T1700/printer.cartridge.matte_black))>0
name: 'Matte Black Ink Level is low on {{HOST.NAME}}. Current level: {{ITEM.LASTVALUE}}%. Replacement part: {{ITEM.LASTVALUE2}}'
priority: WARNING
tags:
- tag: scope
value: availability
- uuid: c74bea431f284f99a226303bd1a8c4fa
expression: last(/HP DesignJet T1700/printer.ink.matte_black)<10 and length(last(/HP DesignJet T1700/printer.cartridge.matte_black))>0
name: 'Matte Black Ink Level is critically low on {{HOST.NAME}}. Current level: {{ITEM.LASTVALUE}}%. Replacement part: {{ITEM.LASTVALUE2}}'
priority: HIGH
tags:
- tag: scope
value: availability
- uuid: ca0401e4b6ad4ea4a3997aa784f0cf44
name: Photo Black Ink Part Number
type: SNMP_AGENT
snmp_oid: 1.3.6.1.2.1.43.11.1.1.6.1.2
key: printer.cartridge.photo_black
delay: 1h
history: 90d
trends: 0d
value_type: TEXT
description: Photo Black Ink Cartridge Part Number (HP 730 P2V73A)
preprocessing: *id001
tags:
- tag: component
value: supplies
- tag: type
value: info
- uuid: 696a16edeec14b8eb49e8faaecc620a0
name: Photo Black Ink Level
type: SNMP_AGENT
snmp_oid: 1.3.6.1.4.1.11.2.3.9.4.2.1.4.1.5.4.2.1.0
key: printer.ink.photo_black
delay: 1h
history: 90d
trends: 365d
value_type: FLOAT
units: '%'
description: Photo Black Ink Level Percentage (HP proprietary OID)
tags:
- tag: component
value: supplies
- tag: type
value: level
- tag: color
value: photo_black
triggers:
- uuid: 3546b3857d41408dbe0c9bdca2894d3d
expression: last(/HP DesignJet T1700/printer.ink.photo_black)<20 and length(last(/HP DesignJet T1700/printer.cartridge.photo_black))>0
name: 'Photo Black Ink Level is low on {{HOST.NAME}}. Current level: {{ITEM.LASTVALUE}}%. Replacement part: {{ITEM.LASTVALUE2}}'
priority: WARNING
tags:
- tag: scope
value: availability
- uuid: 86bdf2ac709c4aa190fff165854d1ac1
expression: last(/HP DesignJet T1700/printer.ink.photo_black)<10 and length(last(/HP DesignJet T1700/printer.cartridge.photo_black))>0
name: 'Photo Black Ink Level is critically low on {{HOST.NAME}}. Current level: {{ITEM.LASTVALUE}}%. Replacement part: {{ITEM.LASTVALUE2}}'
priority: HIGH
tags:
- tag: scope
value: availability
- uuid: f556642dedc0478199756286434e402e
name: Cyan Ink Part Number
type: SNMP_AGENT
snmp_oid: 1.3.6.1.2.1.43.11.1.1.6.1.6
key: printer.cartridge.cyan
delay: 1h
history: 90d
trends: 0d
value_type: TEXT
description: Cyan Ink Cartridge Part Number (HP 730 P2V68A)
preprocessing: *id001
tags:
- tag: component
value: supplies
- tag: type
value: info
- uuid: 08bdb3aae6d241b3b7deb7710e3a975c
name: Cyan Ink Level
type: SNMP_AGENT
snmp_oid: 1.3.6.1.4.1.11.2.3.9.4.2.1.4.1.5.4.6.1.0
key: printer.ink.cyan
delay: 1h
history: 90d
trends: 365d
value_type: FLOAT
units: '%'
description: Cyan Ink Level Percentage (HP proprietary OID)
tags:
- tag: component
value: supplies
- tag: type
value: level
- tag: color
value: cyan
triggers:
- uuid: 1631b17f908a4f3db74f64d1d5d8777e
expression: last(/HP DesignJet T1700/printer.ink.cyan)<20 and length(last(/HP DesignJet T1700/printer.cartridge.cyan))>0
name: 'Cyan Ink Level is low on {{HOST.NAME}}. Current level: {{ITEM.LASTVALUE}}%. Replacement part: {{ITEM.LASTVALUE2}}'
priority: WARNING
tags:
- tag: scope
value: availability
- uuid: 0e9990ee0cd9456b9ceb1f92296aa6de
expression: last(/HP DesignJet T1700/printer.ink.cyan)<10 and length(last(/HP DesignJet T1700/printer.cartridge.cyan))>0
name: 'Cyan Ink Level is critically low on {{HOST.NAME}}. Current level: {{ITEM.LASTVALUE}}%. Replacement part: {{ITEM.LASTVALUE2}}'
priority: HIGH
tags:
- tag: scope
value: availability
- uuid: 3b5fa9757ad94156853abcc84835f2e7
name: Magenta Ink Part Number
type: SNMP_AGENT
snmp_oid: 1.3.6.1.2.1.43.11.1.1.6.1.5
key: printer.cartridge.magenta
delay: 1h
history: 90d
trends: 0d
value_type: TEXT
description: Magenta Ink Cartridge Part Number (HP 730 P2V69A)
preprocessing: *id001
tags:
- tag: component
value: supplies
- tag: type
value: info
- uuid: 2f282ed4cf084d08a979c55950cef358
name: Magenta Ink Level
type: SNMP_AGENT
snmp_oid: 1.3.6.1.4.1.11.2.3.9.4.2.1.4.1.5.4.5.1.0
key: printer.ink.magenta
delay: 1h
history: 90d
trends: 365d
value_type: FLOAT
units: '%'
description: Magenta Ink Level Percentage (HP proprietary OID)
tags:
- tag: component
value: supplies
- tag: type
value: level
- tag: color
value: magenta
triggers:
- uuid: 919c27a3aedb4f76a9f59e603e5dcded
expression: last(/HP DesignJet T1700/printer.ink.magenta)<20 and length(last(/HP DesignJet T1700/printer.cartridge.magenta))>0
name: 'Magenta Ink Level is low on {{HOST.NAME}}. Current level: {{ITEM.LASTVALUE}}%. Replacement part: {{ITEM.LASTVALUE2}}'
priority: WARNING
tags:
- tag: scope
value: availability
- uuid: a25e8aeaba3f4e18ba40708d66c07094
expression: last(/HP DesignJet T1700/printer.ink.magenta)<10 and length(last(/HP DesignJet T1700/printer.cartridge.magenta))>0
name: 'Magenta Ink Level is critically low on {{HOST.NAME}}. Current level: {{ITEM.LASTVALUE}}%. Replacement part: {{ITEM.LASTVALUE2}}'
priority: HIGH
tags:
- tag: scope
value: availability
- uuid: 8066d531aeef4232a2f86c7673dcb0ca
name: Yellow Ink Part Number
type: SNMP_AGENT
snmp_oid: 1.3.6.1.2.1.43.11.1.1.6.1.4
key: printer.cartridge.yellow
delay: 1h
history: 90d
trends: 0d
value_type: TEXT
description: Yellow Ink Cartridge Part Number (HP 730 P2V70A)
preprocessing: *id001
tags:
- tag: component
value: supplies
- tag: type
value: info
- uuid: b4c3b5b7a70e4479adc666bfa2b5dee5
name: Yellow Ink Level
type: SNMP_AGENT
snmp_oid: 1.3.6.1.4.1.11.2.3.9.4.2.1.4.1.5.4.4.1.0
key: printer.ink.yellow
delay: 1h
history: 90d
trends: 365d
value_type: FLOAT
units: '%'
description: Yellow Ink Level Percentage (HP proprietary OID)
tags:
- tag: component
value: supplies
- tag: type
value: level
- tag: color
value: yellow
triggers:
- uuid: 45590af45de840b691c9ce240ea59358
expression: last(/HP DesignJet T1700/printer.ink.yellow)<20 and length(last(/HP DesignJet T1700/printer.cartridge.yellow))>0
name: 'Yellow Ink Level is low on {{HOST.NAME}}. Current level: {{ITEM.LASTVALUE}}%. Replacement part: {{ITEM.LASTVALUE2}}'
priority: WARNING
tags:
- tag: scope
value: availability
- uuid: 0a60116b422e44398fe9965e78efde24
expression: last(/HP DesignJet T1700/printer.ink.yellow)<10 and length(last(/HP DesignJet T1700/printer.cartridge.yellow))>0
name: 'Yellow Ink Level is critically low on {{HOST.NAME}}. Current level: {{ITEM.LASTVALUE}}%. Replacement part: {{ITEM.LASTVALUE2}}'
priority: HIGH
tags:
- tag: scope
value: availability
- uuid: d2d5e4c992b1430b96a0c81001bda0f4
name: Gray Ink Part Number
type: SNMP_AGENT
snmp_oid: 1.3.6.1.2.1.43.11.1.1.6.1.1
key: printer.cartridge.gray
delay: 1h
history: 90d
trends: 0d
value_type: TEXT
description: Gray Ink Cartridge Part Number (HP 730 P2V72A)
preprocessing: *id001
tags:
- tag: component
value: supplies
- tag: type
value: info
- uuid: 62fd4c82a74c405993e2133fc2482bdf
name: Gray Ink Level
type: SNMP_AGENT
snmp_oid: 1.3.6.1.4.1.11.2.3.9.4.2.1.4.1.5.4.1.1.0
key: printer.ink.gray
delay: 1h
history: 90d
trends: 365d
value_type: FLOAT
units: '%'
description: Gray Ink Level Percentage (HP proprietary OID)
tags:
- tag: component
value: supplies
- tag: type
value: level
- tag: color
value: gray
triggers:
- uuid: d4ff92150d2b4cc693ab656efe57748f
expression: last(/HP DesignJet T1700/printer.ink.gray)<20 and length(last(/HP DesignJet T1700/printer.cartridge.gray))>0
name: 'Gray Ink Level is low on {{HOST.NAME}}. Current level: {{ITEM.LASTVALUE}}%. Replacement part: {{ITEM.LASTVALUE2}}'
priority: WARNING
tags:
- tag: scope
value: availability
- uuid: d99de94b22c24ef69154f5719f5b865f
expression: last(/HP DesignJet T1700/printer.ink.gray)<10 and length(last(/HP DesignJet T1700/printer.cartridge.gray))>0
name: 'Gray Ink Level is critically low on {{HOST.NAME}}. Current level: {{ITEM.LASTVALUE}}%. Replacement part: {{ITEM.LASTVALUE2}}'
priority: HIGH
tags:
- tag: scope
value: availability