Ad Widget

Collapse

Import Mibs to zabbix und save as template

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • makemeasandwich
    Member
    • Apr 2015
    • 34

    #1

    Import Mibs to zabbix und save as template

    Hello,

    is there a script for zabbix that adds me all OIDS of the mib into a template?
    I have a mib with 1000 oids I dont want to add them all manually by creating items and graphs everytime.

    SNMP Builder doesnt work as it doesnt display tables.

    Thanks for the repply!
  • Akint
    Junior Member
    • Feb 2015
    • 5

    #2
    Hello,

    Just in case you have not worked it out yet, check this: https://github.com/Akint/utils/tree/master/mib2template
    Just put your MIB file whereever Net-SNMP can find it (usually, ~/.snmp/mibs/), and run the script as described in README. E.g.:
    ./mib2template.pl --module IF-MIB --root .1.3.6.1.2.1.2 --group Templates

    If you face any issues with this script, please let me know.

    Comment

    • makemeasandwich
      Member
      • Apr 2015
      • 34

      #3
      Originally posted by Akint
      Hello,

      Just in case you have not worked it out yet, check this: https://github.com/Akint/utils/tree/master/mib2template
      Just put your MIB file whereever Net-SNMP can find it (usually, ~/.snmp/mibs/), and run the script as described in README. E.g.:
      ./mib2template.pl --module IF-MIB --root .1.3.6.1.2.1.2 --group Templates

      If you face any issues with this script, please let me know.
      I sadly havent worked it out yet. The server is not sending the right information back so I guess there is something wrong in the php script.

      hey cool! I will check it out later. Does it create graphs too for the OIDS ?

      thanks!

      Comment

      • Akint
        Junior Member
        • Feb 2015
        • 5

        #4
        Originally posted by makemeasandwich
        Does it create graphs too for the OIDS ?
        Nope, it only creates items and discoveries with item prototypes. After you import the template into Zabbix, you should manually clean those items out and create triggers and graphs.
        By cleaning items I mean removal of unnecessary ones (there would be tons of them) and possible value/data types correction. Right now the script creates decimal integer items for counters/gauges/integers and character items otherwise.

        Comment

        • makemeasandwich
          Member
          • Apr 2015
          • 34

          #5
          Okay thanks for the Help!!

          That World be too much work at the end ;/

          The Browser Works apart from Not recognizing the tables like other mib Browser (snmpB). However i dont know what is wrong exactly but i think the Feature is implementied if you look into the code.

          Its too bad. .. ;-(

          Comment

          • HellLordKB
            Junior Member
            • Feb 2015
            • 10

            #6
            For what its worth i was digging around the web and I believe I was experiencing the same issue using snmpbuilder with tables that the first post makemeasandwhich was.

            the SNMPBuilder extras add-on does work for tables however there is at least 1 bug which makes it misleading.

            If when using SNMP builder you click on a SNMP table in the OID Tree, and you see a whole bunch of lines with messages like bad, error, could not find, failed, etc, hover your mouse over those errors and scroll down and you may see your desired results.

            it looks like snmpbuilder has a big when viewing SNMP OID Tables where it tries to query all the entries in the table with ALL the MIBs in your mins directoty instead of just the MIB you selected in the "MIB" drop down box in the top right corner.

            A work around that worked for me was the following
            1) Look through the list of errors in the rows from the top
            2) note the MIB file name that its throwing errors about. For me it was all CISCO and OLD-CISCO MIBS.
            3) go into your zabbix servers MIBs directory and, if your not using those MIBs you noted that it reorder on, move them from the configured MIBs directory to anywhere else.
            4) move around the mib tree into a non table, and try viewing a table again and see if the errors decrease.
            5) repeat moving necessary mibs from the MIBs directory that you are getting errors on until you get no more errors.

            seems like this is a bug in snap builder although it sound like its development is mostly halted, but that could be a unfair assessment.

            Couple more recommendations i've learned through some testing.

            1) The bug i mentioned above is due to snap builder trying to use mibs you didn't ask it to use.

            2) there is a separate bug where itf after you click on a row shown from MIB table entry, it will import the OID and create an item template shown below. However while it imports the SNMP OID correctly for a table, the description is not imported correctly and you'll end up getting the same description shown for every OID in the table.

            3) If you trying to use Snmp builder with OID tables, instead of clicking on each row, you can click on the column heading in the "OID Data" table section, and SNMP builder will eventually import all the OIDs in that table and create 1 item for each entry in the table. This can contain some time and you might get script timeout/errors in your browser and you might get a spinning gear icon. Depending on how many rows are in the OID Table, after you click the Column Heading, I often don't see a result in the items list for ~3-4 minutes. This delay makes sense because of the amount of data its processing.
            Last edited by HellLordKB; 06-05-2016, 17:14.

            Comment

            • kloczek
              Senior Member
              • Jun 2006
              • 1771

              #7
              Originally posted by Akint
              Hello,

              Just in case you have not worked it out yet, check this: https://github.com/Akint/utils/tree/master/mib2template
              Just put your MIB file whereever Net-SNMP can find it (usually, ~/.snmp/mibs/), and run the script as described in README. E.g.:
              ./mib2template.pl --module IF-MIB --root .1.3.6.1.2.1.2 --group Templates

              If you face any issues with this script, please let me know.
              IMO using straight what it would be generated by such script is pointless.
              Why? First even so fundamental MIB like SNMPv2 of IF provides to many things potentially can be monitored. Typical SNMP agent provides few thousands metrics which query in over single query may take even minute or more. Even enterprise devices like storage arrays have quite weak CPU used in BMC which is usually used to run SNMP agent. As result it is quite easy to overload BMC.
              Secondly none of the MIBs has any details which can be used on constructing anything on top of plain monitoring like alarming (triggers), graphs, calculated items, screens and so on.

              Using above may be useful on first stage of prototyping MIB based templates.
              Every device monitoring can be assembled from such MIB based templates. However some devices are using selectively only subset of exact MIB metrics.
              http://uk.linkedin.com/pub/tomasz-k%...zko/6/940/430/
              https://kloczek.wordpress.com/
              zapish - Zabbix API SHell binding https://github.com/kloczek/zapish
              My zabbix templates https://github.com/kloczek/zabbix-templates

              Comment

              Working...