Ad Widget

Collapse

OID data retrieved as HEX with spaces, when the source is TEXT

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • imailuk
    Junior Member
    • Nov 2021
    • 8

    #1

    OID data retrieved as HEX with spaces, when the source is TEXT

    Using tools I can SNMPWalk an OID and get a TEXT response. Typically this is on our HP laser printers, Toner Model Name'.

    When I use Ubuntu 20.04 with SNMP, the data is retrieved as HEX with spaces (e.g. A5 D5 2C etc.). Translated in a converter, the HEX is the text I'm after to appear in Zabbix (item data). Of course, Zabbix relies on SNMP on the host for the data. Pre-processing in Zabbix will allow conversion only to Decimal (numeric).

    My question is.. Is there a way to pre-process or convert the HEX (with spaces) OID data in a Zabbix so that it is stored as TEXT (e.g. ASCII).

    Any help appreciated.
  • Answer selected by imailuk at 30-05-2022, 10:56.
    Markku
    Senior Member
    Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
    • Sep 2018
    • 1782

    Yes, you can use JavaScript preprocessing and write a script that converts the results.

    Markku

    Comment


    • imailuk
      imailuk commented
      Editing a comment
      Now, if only I could code in JavaScript and figure out how to apply that in this context!? Appreciate this is the current correct answer, hopefully the Devs will add in a more friendly 'option' along with the other pre-processing options. Many Thanks.
  • Markku
    Senior Member
    Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
    • Sep 2018
    • 1782

    #2
    Yes, you can use JavaScript preprocessing and write a script that converts the results.

    Markku

    Comment


    • imailuk
      imailuk commented
      Editing a comment
      Now, if only I could code in JavaScript and figure out how to apply that in this context!? Appreciate this is the current correct answer, hopefully the Devs will add in a more friendly 'option' along with the other pre-processing options. Many Thanks.
  • Hamardaban
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • May 2019
    • 2713

    #3
    It might be interesting to take a look at this

    Comment


    • imailuk
      imailuk commented
      Editing a comment
      Thankyou for the pointer, can't translate the page from Russian, but the code looks interesting - I'm not a JavaScript coder, so this will be a huge endeavour for me - will likely just leave it until the Devs pick up on this and implement Hex to ASCII in pre-procesing as an option (if they do). Many Thanks.
Working...