# 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: ```javascript 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 ```yaml - uuid: 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 | ## Related - **ShopDB**: `/home/camp/projects/windows/shopdb/` - **Zabbix API integration**: `shopdb/includes/zabbix_all_supplies.asp` - **Display page**: `shopdb/displayprinter.asp`