cproudlock 1d25195316 Add CLAUDE.md with project instructions
Documents:
- Zabbix template requirements for ShopDB integration
- Supply item naming rules ("Level" in name, percentage values)
- YAML structure (triggers inside items, valid UUIDv4)
- Common import errors and fixes
- HID DTC4500e device-specific notes

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-17 14:20:18 -05:00

SNMP Scanner / Zabbix Templates

This repository contains SNMP-based Zabbix templates and related tooling for monitoring network devices.

Zabbix Template Requirements for ShopDB Integration

Templates created here are used with the ShopDB displayprinter.asp page, which pulls supply data from Zabbix via API. To ensure compatibility:

Supply Level Items

For supply items to appear in displayprinter.asp, they must:

  1. Include "Level" in the item name - The page filters for items containing "Level"

    • Good: Ribbon Level, Toner Level Black, Ink Level Cyan
    • Bad: Ribbon Remaining, Toner Count, Ink Status
  2. Return a percentage value (0-100) - The page displays items as progress bars

    • If the SNMP OID returns a raw count, add preprocessing to convert to percentage
    • Example: For a 500-print ribbon, use JavaScript preprocessing:
      var remaining = parseInt(value, 10);
      var percent = (remaining / 500) * 100;
      return Math.min(100, Math.max(0, percent.toFixed(1)));
      
  3. Use appropriate units - Set units: '%' for percentage values

Example Item Structure

- uuid: <valid-uuidv4>
  name: Ribbon Level           # Must contain "Level"
  type: SNMP_AGENT
  snmp_oid: 'get[1.3.6.1.4.1.xxx]'
  key: device.ribbon.level
  value_type: FLOAT
  units: '%'                   # Percentage
  preprocessing:
  - type: JAVASCRIPT
    parameters:
    - |
      // Convert raw count to percentage
      var remaining = parseInt(value, 10);
      var capacity = 500;  // Adjust per consumable
      return Math.min(100, Math.max(0, (remaining / capacity) * 100));

Zabbix Import Requirements

  • UUIDs must be valid UUIDv4 - 32 hex characters without dashes
  • Triggers must be nested inside items - Not at the template level
  • Generate UUIDs with: python3 -c "import uuid; print(uuid.uuid4().hex)"

Templates

Template Device Notes
zabbix_template_hid_dtc4500e.yaml HID Fargo DTC4500e Card Printer YMCKO 500-print ribbon
  • ShopDB: /home/camp/projects/windows/shopdb/
  • Zabbix API integration: shopdb/includes/zabbix_all_supplies.asp
  • Display page: shopdb/displayprinter.asp
Description
SNMP scanner for printer discovery and Zabbix template generation
Readme 226 KiB
Languages
Python 99.6%
Shell 0.4%