Ad Widget

Collapse

Normalizing printer supply names -

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • furicle
    Junior Member
    • Feb 2026
    • 6

    #1

    Normalizing printer supply names -

    Zabbix 7.4 on Alma 9

    I'm monitoring a number of network printers using the Universal Printer template and snmp

    It works well, but different manufacturers have different names for their supplies. So when I try to build a dashboard for just the supplies, I end up with multiple entries like
    • "Remaining Black Toner Cartridge S/N:CRUM-123456789"
    • "Remaining Black Toner" and
    • "Remaining Black Cartridge"
    depending on manufacturer.

    I mucked around a bit and tried to put regex in preprocessing on the five item prototypes in the template of universal printer

    Code:
    (?i)^(.*?)\s*(?:toner\s*)?(?:cartridge|module|s/n).*
    replace with
    Code:
     \1 Toner
    but that doesn't seem to be working. Feels like I'm in the wrong spot?

    Where do I insert the regex to standardize things?
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4975

    #2
    (?i)^(.*?)\s*(?:toner\s*)?(?:cartridge|module|s/n).*
    / Delimiter must be escaped with `\`
    Not all of your examples match https://regex101.com/r/bk4Tuq/1

    But in general, item value preprocessing is the correct place to extract something from aqcuired value and modify it...

    Comment

    • furicle
      Junior Member
      • Feb 2026
      • 6

      #3
      Originally posted by cyber
      (?i)^(.*?)\s*(?:toner\s*)?(?:cartridge|module|s/n).*
      / Delimiter must be escaped with `\`
      Not all of your examples match https://regex101.com/r/bk4Tuq/1

      But in general, item value preprocessing is the correct place to extract something from aqcuired value and modify it...
      Thanks for the feedback, I've fixed escaping the \
      The 'remaining' from my example is in the item itself, so that's ok not to match.

      Still not working, even cartridge vs toner. Haven't figured out what I'm missing.

      Comment

      Working...