Ad Widget

Collapse

Printer's Display message (status) using SNMP sometimes shows message as HEXA Values

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pabloarg
    Member
    • Jun 2019
    • 32

    #1

    Printer's Display message (status) using SNMP sometimes shows message as HEXA Values

    Hi guys, first post here!


    I'm using Zabbix for control several printers (Lexmark MS812) and get several values usign SNMP.
    This works fine, but when in some cases text is shown as HEXA values instead of ASCII.

    Wrong item description? I'm missing somethig?

    Regards,

    Click image for larger version

Name:	Zabbix.png
Views:	982
Size:	57.8 KB
ID:	393855




  • clevelas
    Junior Member
    • Mar 2015
    • 22

    #2
    I found this somewhere (not sure where) and modified it slightly. You can add javascript to the preprocessing for the item and include this code:

    Code:
    var out = "";
    
    // If it's not hex and spaces, just return the original
    if (!value.match(/^[0-9A-Fa-f\s]*$/)) {
        return value;
    }
    
    for (var i = 0, nums = value.split(" "); i < nums.length; i++) {
        out += String.fromCharCode(parseInt(nums[i], 16));
    }
    
    return out;

    Comment

    • pabloarg
      Member
      • Jun 2019
      • 32

      #3
      Thanks clevelas, but I missed to say that is Zabbix 4.0.0rc1 in production, so no javascript preprocessing yet
      Last edited by pabloarg; 23-01-2020, 23:25. Reason: typo

      Comment

      • tim.mooney
        Senior Member
        • Dec 2012
        • 1427

        #4
        Originally posted by pabloarg
        I'm using Zabbix for control several printers (Lexmark MS812) and get several values usign SNMP.
        This works fine, but when in some cases text is shown as HEXA values instead of ASCII.

        Wrong item description? I'm missing somethig?
        The first thing I noticed is that the translated text has a character in it (the a with the accent character) that is outside the range of ASCII. That made me wonder if the SNMP OID's object type was one that didn't allow non-ASCII characters. However, I think the RFC3805 Printer MIBv2 does support localization for many OIDs, so I would think it would support characters beyond just ASCII for this field. Interestingly, the original Printer MIB (RFC1759) apparently didn't have support for localization in this field?

        Does your Zabbix server have the Printer MIBv2 loaded?

        You don't want to run your printer this way normally, but if you reconfigure the Lexmark to use English as its language, just during testing, does the SNMP issue go away? I'm just trying to help rule out whether it's the returned value not matching what SNMP says should be allowed for that object type.

        Comment

        • pabloarg
          Member
          • Jun 2019
          • 32

          #5
          Originally posted by tim.mooney
          The first thing I noticed is that the translated text has a character in it (the a with the accent character) that is outside the range of ASCII.

          Good catch Tim. Is natural for me (as argentinian) accent in vowels so I didn't noticed that the problematic message contains "á" and the other not.
          I'm in vacations time now but at return I will verify is this happens with other characters ("ñ", I'm watching you!)

          If it's only happens with "strange" characteres, It should be a bug/feature in zabbix?
          I mean, only happened to me? Due a lot of Zabbix users are Non Latin Alphabet Users maybe this could be useful to others.


          Originally posted by tim.mooney
          You don't want to run your printer this way normally, but if you reconfigure the Lexmark to use English as its language, just during testing, does the SNMP issue go away? I'm just trying to help rule out whether it's the returned value not matching what SNMP says should be allowed for that object type.
          Not possible unfortunately. These equipments are outside my work orbit.
          In the worst case, I will maintain these messages and convert them when necessary (Notepad++ >> "Plugins" Menu >> Converter >> HEX to ASCII)

          Comment

          • pabloarg
            Member
            • Jun 2019
            • 32

            #6
            I opened a bug for this case: https://support.zabbix.com/browse/ZBX-17382

            Comment

            Working...