Ad Widget

Collapse

Converting Hexadecimal values from MIB-file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jarne St
    Member
    • Sep 2019
    • 63

    #1

    Converting Hexadecimal values from MIB-file

    I have a MIB-file from Bosch Security Systems. (vipx_snmp.txt)
    I have converted this mib file to a Zabbix template (Template Bosch Cameras.xml), but when I use the template I got a lot of hexadecimal values:

    Click image for larger version

Name:	Latest Data.png
Views:	2542
Size:	44.3 KB
ID:	400303
    I have looked at https://support.zabbix.com/browse/ZBXNEXT-505, but I can't add the option -Oa from an snmpwalk in the frontend.
    If I use the option -Oa in my snmpwalk I get the correct value, but how can I tell the front-end to use the option -Oa?

    And If I add a perl script, how can I use that script in an Item to translate these values?

    How can I convert these hexadecimal values properly, so that I can read this values?
    I use Zabbix version 4.0.18.

    Thanks for any help!
  • c1support
    Member
    • Apr 2020
    • 47

    #2
    If I understand correctly, I would assume this can be done with preprocessing on the item level.
    Have a look at these:
    - https://www.zabbix.com/documentation.../preprocessing
    - https://www.zabbix.com/documentation...itemtypes/snmp
    -https://www.zabbix.com/documentation...ing_javascript
    Last edited by c1support; 29-04-2020, 20:19.

    Comment

    • Jarne St
      Member
      • Sep 2019
      • 63

      #3
      Yes, I know it can be don by prepossessing.
      (But I use Zabbix 4.0 and there is no such prepossessing in 4.0).

      Can this be done in Zabbix 4.0? Or do I have to upgrade to 4.2 or 4.4?

      Comment

      • Jarne St
        Member
        • Sep 2019
        • 63

        #4
        I think I found a solution.
        If I configure an snmpget in an external script then I get the value that I want.

        Code:
        snmpget -c public -v 1 -Oavq 172.28.132.21:31161 BSS-RCP-MIB::oem-device-name.0
        gives me the output:
        Code:
        "DINION IP starlight 8000 MP."
        But the IP-address and the port in my script are dynamic.
        How are dynnamic arguments passed in external scripts?
        If I have the item key
        Code:
        oem-device-name.sh[{HOST.CONN},{HOST.PORT}]
        how I have to write my shell script to work properly?

        Comment

        • c1support
          Member
          • Apr 2020
          • 47

          #5
          post #3:
          I was not aware this particular feature is not supported in v4.0 (though preprocessing in general is supported by v4.0).
          Is there a specific reason why you shy from updating to v4.4? (I would not recommend v4.2, since it is not officially supported)

          In case you require long term support: v5.0 should be round the corner (was scheduled for March 2020, but probably due to pandemic seems to be slightly delayed).
          Explore pending Zabbix features and get a view of what's to come.

          https://www.zabbix.com/forum/zabbix-...0beta2-out-now

          post #4:
          Don't know exactly, I would need more details to answer this (probably somebody with more experience could easily answer this, though).
          But then again considering maintenance efforts in the long run, I would rather recommend using built-in mechanisms (i.e. preprocessing).
          => I would rater update to Zabbix v4.4 or wait a few days until v5.0 has arrived
          Last edited by c1support; 30-04-2020, 20:39.

          Comment

          • Jarne St
            Member
            • Sep 2019
            • 63

            #6
            Thank you for you answer c1support !

            I will wait a unit the next version v5.0, because I require long term support.

            Comment

            • aib
              Senior Member
              • Jan 2014
              • 1615

              #7
              First of all, Zabbix 4.0 support preprocessing for individual Items.
              Check https://www.zabbix.com/documentation..._preprocessing
              There is an option "Hexadecimal to Decimal", but it is good for numbers. Try it for strings and see how it works.

              Then, using external script also possible. How to pass arguments to external scripts, you can read here https://www.zabbix.com/documentation...types/external
              In general, you creating an Item with key oem-device-name.sh[{HOST.CONN},{HOST.PORT}] and inside the script use $ARGV[0] (for perl) or any specific way to pickup arguments from command line depending on your script language.
              For bash it will be $1, $2 for example.

              Please, remember: external script works only on Zabbix Server/Proxy where it has been placed/saved. If you would like to use external checks for Zabbix Agent, check infor about UserParameters.
              Sincerely yours,
              Aleksey

              Comment

              • Jarne St
                Member
                • Sep 2019
                • 63

                #8
                I have tested it with the option "Hexadecimal to Decimal" but I get an Error:
                Click image for larger version

Name:	Error.png
Views:	2318
Size:	9.6 KB
ID:	400683
                This is wat I get without preprocessing:
                Click image for larger version

Name:	Device name.png
Views:	2279
Size:	3.6 KB
ID:	400684
                So I think I can only use external checks.
                But when I read the documentation for external checks, I read this warning:
                Do not overuse external checks! As each script requires starting a fork process by Zabbix server, running many scripts can decrease Zabbix performance a lot.
                But if the external check is in a templated item, does Zabbix then create a fork process for each host the template is linked to?
                Last edited by Jarne St; 05-05-2020, 15:08.

                Comment

                • c1support
                  Member
                  • Apr 2020
                  • 47

                  #9
                  If I understand correctly, you would like to convert the ASCII values to a string - preferably using preprosessing.

                  Have a look at these:
                  https://support.zabbix.com/browse/ZBXNEXT-505 (coming from https://www.zabbix.com/forum/zabbix-...bix-item-value)

                  Comment

                  Working...