Ad Widget

Collapse

Assistance with importing .mib file to Zabbix to create a new template

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • greavette
    Member
    • Jul 2015
    • 82

    #1

    Assistance with importing .mib file to Zabbix to create a new template

    Hello,

    I didn't want to hijack this thread - https://www.zabbix.com/forum/showthread.php?t=49982 as the OP seemed to have things worked out.

    But the above thread did lead me in the direction I want to go in that I need to use a script called mib2template...but I need some help with understanding what I need to do.

    I have a NAS device from Imation and they provide an MIB file which I've downloaded to my PC.

    1. Where do I get the root OID from? I've logged into our Zabbix Server and issued the following command - snmpwalk -v 2c -c public <host IP> (where I used the IP of our NAS). The second line in the results of issuing snmpwalk has this:
    iso.3.6.1.2.1.1.2.0 = OID: iso.3.6.1.4.1.7933.1.10
    Is this my root OID?

    2. Do I move the .MIB file I've downloaded to my Zabbix Server and run the mib2template script? What is output from this script?

    3. What are the next steps to creating the template in Zabbix once I've run themib2template script? Do I go back into the Zabbix Web GUI and create a new template and name it whatever I wan?

    Thank you in advance for any direction you can provide.
  • Akint
    Junior Member
    • Feb 2015
    • 5

    #2
    Hello,

    First of all, you should put your MIB file on your Zabbix server whereever Net-SNMP can find it (usually, ~/.snmp/mibs/).

    Second, root OID is used by script as a start. Every child of this OID will be added to template. If you want to find it, you can play around with snmptranslate. Custom branches are usually located under .1.3.6.1.4.1 OID, so I can do something like this for HP servers' MIBs, for example:
    Code:
    $ snmptranslate -m CPQHLTH-MIB -Tz | egrep '"1\.3\.6\.1\.4\.1\.[0-9]+"'
    "compaq"                        "1.3.6.1.4.1.232"
    1.3.6.1.4.1.232 would be the root OID for my template.

    Third, run mib2template.pl at your Zabbix server as follows:
    Code:
    ./mib2template.pl --module CPQHLTH-MIB --root .1.3.6.1.4.1.232 --group Templates > template.xml
    Of course, you must replace "CPQHLTH-MIB" for your MIB name and ".1.3.6.1.4.1.232" for the root OID you found.
    As a result, the script will produce generated XML to STDOUT, which will be captured to file template.xml. Now you can go to Zabbix frontend and import template.xml as a template.

    Comment


    • Leandro Goethals
      Leandro Goethals commented
      Editing a comment
      Hi,
      I have done the grep of HUAWAI-MIB and it is 1.3.6.1.4.1.2011 however when i translate the mib then | it to mib2zabbix with as root oid 1.3.6.1.4.1.2011 the it says perl line 475 oid not found in this tree.
      But when i do mib2zabbix HUAWEI.mib it makes the template but without items and all the good stuff.
      Net-snmp is kinda working it only translates "iso"(1) but it doesn't give errors.
      Do u know what the problem is, also for some reason i can't make a new post on this forum
  • greavette
    Member
    • Jul 2015
    • 82

    #3
    Thanks very much for taking the time to respond to my post Akint.

    Ok, I've created a ~/.snmp/mibs folder (they didn't exist) and I've moved my NAS.mib to this location.

    I've issued the snmptranslate like so:

    Code:
    snmptranslate -m ~/.snmp/mibs/NAS.mib -Tz | egrep '"1\.3\.6\.1\.4\.1\.[0-9]+"'
    Unfortunately I'm not seeing anything like the example you gave in my results that would tell me what the OID would be for our NAS device? Here is the output I've received. Did I do something wrong in my snmptranslate?

    HTML Code:
    /home/user/.snmp/mibs:/usr/share/snmp/mibs:/usr/share/snmp/mibs/iana:/usr/share/snmp/mibs/ietf:/usr/share/mibs/site:/usr/share/snmp/mibs:/usr/share/mibs/iana:/usr/share/mibs/ietf:/usr/share/mibs/netsnmp
    Cannot find module (SNMPv2-TC): At line 9 in /home/user/.snmp/mibs/NAS.mib
    Cannot find module (SNMPv2-SMI): At line 13 in /home/user/.snmp/mibs/NAS.mib
    Did not find 'DisplayString' in module #-1 (/home/user/.snmp/mibs/NAS.mib)
    Did not find 'TruthValue' in module #-1 (/home/user/.snmp/mibs/NAS.mib)
    Did not find 'enterprises' in module #-1 (/home/user/.snmp/mibs/NAS.mib)
    Unlinked OID in IMATION-NAS-MIB: imationCorp ::= { enterprises 7933 }
    Undefined identifier: enterprises near line 37 of /home/user/.snmp/mibs/NAS.mib
    Cannot adopt OID in IMATION-NAS-MIB: nasNetworkInfoEntry ::= { nasNetworkInfoTable 1 }
    Cannot adopt OID in IMATION-NAS-MIB: nasFileSysInfoTable ::= { nasFileSystem 1 }
    Cannot adopt OID in IMATION-NAS-MIB: nasSystemInfoEntry ::= { nasSystemInfoTable 1 }
    Cannot adopt OID in IMATION-NAS-MIB: nasFilesystemUsage ::= { nasFileSysInfoEntry 7 }
    Cannot adopt OID in IMATION-NAS-MIB: nasFilesystemFreeSize ::= { nasFileSysInfoEntry 6 }
    Cannot adopt OID in IMATION-NAS-MIB: nasFilesystemUsedSize ::= { nasFileSysInfoEntry 5 }
    Cannot adopt OID in IMATION-NAS-MIB: nasFilesystemTotalSize ::= { nasFileSysInfoEntry 4 }
    Cannot adopt OID in IMATION-NAS-MIB: nasFilesystemDevice ::= { nasFileSysInfoEntry 3 }
    Cannot adopt OID in IMATION-NAS-MIB: nasFilesystemMountPoint ::= { nasFileSysInfoEntry 2 }
    Cannot adopt OID in IMATION-NAS-MIB: nasFilesystemIndex ::= { nasFileSysInfoEntry 1 }
    Cannot adopt OID in IMATION-NAS-MIB: ptProduct ::= { imationCorp 1 }
    Cannot adopt OID in IMATION-NAS-MIB: nasNetinfoOutflow2 ::= { nasNetworkInfoEntry 24 }
    Cannot adopt OID in IMATION-NAS-MIB: nasNetinfoInflow2 ::= { nasNetworkInfoEntry 23 }
    Cannot adopt OID in IMATION-NAS-MIB: nasNetinfoWOL2 ::= { nasNetworkInfoEntry 22 }
    Cannot adopt OID in IMATION-NAS-MIB: nasNetinfoMTU2 ::= { nasNetworkInfoEntry 21 }
    Cannot adopt OID in IMATION-NAS-MIB: nasNetinfoLink2 ::= { nasNetworkInfoEntry 20 }
    Cannot adopt OID in IMATION-NAS-MIB: nasNetinfoLSpeed2 ::= { nasNetworkInfoEntry 19 }
    Cannot adopt OID in IMATION-NAS-MIB: nasNetinfoLMode2 ::= { nasNetworkInfoEntry 18 }
    Cannot adopt OID in IMATION-NAS-MIB: nasNetinfoGateway2 ::= { nasNetworkInfoEntry 17 }
    Cannot adopt OID in IMATION-NAS-MIB: nasNetinfoNetMask2 ::= { nasNetworkInfoEntry 16 }
    Cannot adopt OID in IMATION-NAS-MIB: nasNetinfoIP2 ::= { nasNetworkInfoEntry 15 }
    Cannot adopt OID in IMATION-NAS-MIB: nasNetinfoOutflow1 ::= { nasNetworkInfoEntry 14 }
    Cannot adopt OID in IMATION-NAS-MIB: nasNetinfoInflow1 ::= { nasNetworkInfoEntry 13 }
    Cannot adopt OID in IMATION-NAS-MIB: nasNetinfoWOL1 ::= { nasNetworkInfoEntry 12 }
    Cannot adopt OID in IMATION-NAS-MIB: nasNetinfoMTU1 ::= { nasNetworkInfoEntry 11 }
    Cannot adopt OID in IMATION-NAS-MIB: nasNetinfoLink1 ::= { nasNetworkInfoEntry 10 }
    Cannot adopt OID in IMATION-NAS-MIB: nasNetinfoLSpeed1 ::= { nasNetworkInfoEntry 9 }
    Cannot adopt OID in IMATION-NAS-MIB: nasNetinfoLMode1 ::= { nasNetworkInfoEntry 8 }
    Cannot adopt OID in IMATION-NAS-MIB: nasNetinfoGateway1 ::= { nasNetworkInfoEntry 7 }
    Cannot adopt OID in IMATION-NAS-MIB: nasNetinfoNetMask1 ::= { nasNetworkInfoEntry 6 }
    Cannot adopt OID in IMATION-NAS-MIB: nasNetinfoIP1 ::= { nasNetworkInfoEntry 5 }
    Cannot adopt OID in IMATION-NAS-MIB: nasNetinfoBoundType ::= { nasNetworkInfoEntry 4 }
    Cannot adopt OID in IMATION-NAS-MIB: nasNetinfoDNS2 ::= { nasNetworkInfoEntry 3 }
    Cannot adopt OID in IMATION-NAS-MIB: nasNetinfoDNS1 ::= { nasNetworkInfoEntry 2 }
    Cannot adopt OID in IMATION-NAS-MIB: nasNetinfoHostName ::= { nasNetworkInfoEntry 1 }
    Cannot adopt OID in IMATION-NAS-MIB: imationCorp ::= { enterprises 7933 }
    Cannot adopt OID in IMATION-NAS-MIB: nasMemoryUsage ::= { nasSystemInfoEntry 6 }
    Cannot adopt OID in IMATION-NAS-MIB: nasFreeMemory ::= { nasSystemInfoEntry 5 }
    Cannot adopt OID in IMATION-NAS-MIB: nasUsedMemory ::= { nasSystemInfoEntry 4 }
    Cannot adopt OID in IMATION-NAS-MIB: nasTotalMemory ::= { nasSystemInfoEntry 3 }
    Cannot adopt OID in IMATION-NAS-MIB: nasCPUUsage ::= { nasSystemInfoEntry 2 }
    Cannot adopt OID in IMATION-NAS-MIB: nasSystemIndex ::= { nasSystemInfoEntry 1 }
    Cannot adopt OID in IMATION-NAS-MIB: nasNetworkInfoTable ::= { nasNetwork 1 }
    Cannot adopt OID in IMATION-NAS-MIB: nasMIB ::= { ptProduct 30 }
    Cannot adopt OID in IMATION-NAS-MIB: nasSystemInfoTable ::= { nasSystem 1 }
    Cannot adopt OID in IMATION-NAS-MIB: nasFileSysInfoEntry ::= { nasFileSysInfoTable 1 }
    Cannot adopt OID in IMATION-NAS-MIB: nasFileSystem ::= { nasMIB 3 }
    Cannot adopt OID in IMATION-NAS-MIB: nasNetwork ::= { nasMIB 2 }
    Cannot adopt OID in IMATION-NAS-MIB: nasSystem ::= { nasMIB 1 }
    Thank you.

    Comment

    • Akint
      Junior Member
      • Feb 2015
      • 5

      #4
      Originally posted by greavette
      HTML Code:
      /home/user/.snmp/mibs:/usr/share/snmp/mibs:/usr/share/snmp/mibs/iana:/usr/share/snmp/mibs/ietf:/usr/share/mibs/site:/usr/share/snmp/mibs:/usr/share/mibs/iana:/usr/share/mibs/ietf:/usr/share/mibs/netsnmp
      Cannot find module (SNMPv2-TC): At line 9 in /home/user/.snmp/mibs/NAS.mib
      Cannot find module (SNMPv2-SMI): At line 13 in /home/user/.snmp/mibs/NAS.mib
      Did not find 'DisplayString' in module #-1 (/home/user/.snmp/mibs/NAS.mib)
      Did not find 'TruthValue' in module #-1 (/home/user/.snmp/mibs/NAS.mib)
      Did not find 'enterprises' in module #-1 (/home/user/.snmp/mibs/NAS.mib)
      Unlinked OID in IMATION-NAS-MIB: imationCorp ::= { enterprises 7933 }
      Undefined identifier: enterprises near line 37 of /home/user/.snmp/mibs/NAS.mib
      As I can see from this, you have MIBs SNMPv2-TC and SNMPv2-SMI missed. Probably you should install default MIBs (package net-snmp-libs, the name may vary depending upon you OS distro). Or you can just download those MIBs and put them to ~/.snmp/mibs too.

      After you install all missed MIBs I mentioned, your root OID should be .1.3.6.1.4.1.7933.

      Comment

      • Akint
        Junior Member
        • Feb 2015
        • 5

        #5
        A little tip =)
        Originally posted by greavette
        Code:
        snmptranslate -m ~/.snmp/mibs/NAS.mib -Tz | egrep '"1\.3\.6\.1\.4\.1\.[0-9]+"'
        If I am not mistaken, snmptranslate should be run as follows (you should use module name, not filename):
        Code:
        snmptranslate -m IMATION-NAS-MIB -Tz
        Quote from "man snmpcmd":
        -m MIBLIST
        Specifies a colon separated list of MIB modules (not files) to load for this application. This overrides (or augments) the environment variable MIBS, the snmp.conf directive mibs, and the list of MIBs hardcoded into the Net-SNMP library.

        If MIBLIST has a leading '-' or '+' character, then the MIB modules listed are loaded in addition to the default list, coming before or after this list respectively. Otherwise, the specified MIBs are loaded instead of this default list.

        The special keyword ALL is used to load all MIB modules in the MIB directory search list. Every file whose name does not begin with "." will be parsed as if it were a MIB file.

        Comment

        • Taner
          Member
          • Apr 2018
          • 47

          #6
          Hello, I am new in this area.


          I am with the latest Zabbix Server Appliance 3.4 +.


          I want to generate template for Zabbix from Mikrotik MiB file.


          I find SNMP Builder and two perl scripts.
          The perl scripts are mib2template.pl and mib2zabbix.pl.

          I think SNMP Builder doesn't work in latest Zabbix.

          Two scripts also don't work....


          I downloaded Mikrotik.mib file.
          I downloaded mib2zabbix.pl.
          I copied them to /usr/share/snmp/mibs/
          I run command chmod 777 to file mib2zabbix.pl.

          Now I run snmpwalk -v 2c -c public 192.168.0.2
          192.168.0.2 is my Mikrotik Router OS.

          And I see:

          iso.3.6.1.2.1.1.1.0 = STRING: "RouterOS x86"
          iso.3.6.1.2.1.1.2.0 = OID: iso.3.6.1.4.1.14988.1
          iso.3.6.1.2.1.1.3.0 = Timeticks: (9239400) 1 day, 1:39:54.00
          iso.3.6.1.2.1.1.4.0 = STRING: "Taner"
          iso.3.6.1.2.1.1.5.0 = STRING: "MikroTik"
          iso.3.6.1.2.1.1.6.0 = STRING: "Shumen"
          and so and so.

          I run now:
          snmptranslate -m /usr/share/snmp/mibs/Mikrotik.mib -Tz | egrep '"1\.3\.6\.1\.4\.1\.[0-9]+"'

          And my result is:
          "mikrotik" "1.3.6.1.4.1.14988"

          Now I run:
          ./mib2template.pl --module Mikrotik.mib --root .1.3.6.1.4.1.14988 --group Templates > template.xml

          And the result is:
          Can't locate Date/Format.pm in @INC (you may need to install the Date::Format module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.22.1 /usr/local/share/perl/5.22.1 /usr/lib/x86_64-linux-gnu/perl5/5.22 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.22 /usr/share/perl/5.22 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at ./mib2template.pl line 8.
          BEGIN failed--compilation aborted at ./mib2template.pl line 8.

          I try to add # before line 8 and try again to run command to generate xml but then I receive error in line 10, 11, 13 and so and so...............


          I try and with mib2zabbix.pl.
          I run this command:
          ./mib2zabbix.pl --module Mikrotik.mib --root .1.3.6.1.4.1.14988 --group Templates > template.xml

          And the result is:
          Can't locate Date/Format.pm in @INC (you may need to install the Date::Format module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.22.1 /usr/local/share/perl/5.22.1 /usr/lib/x86_64-linux-gnu/perl5/5.22 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.22 /usr/share/perl/5.22 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at ./mib2zabbix.pl line 81.
          BEGIN failed--compilation aborted at ./mib2zabbix.pl line 81.

          There I receive error in line 81 and I put # before line 80 and try to run command again but this time I receive this message:
          Smartmatch is experimental at ./mib2zabbix.pl line 475.
          Unknown option: module
          Usage:
          mib2zabbix.pl -o <OID> [OPTIONS]...

          Export loaded SNMP MIB OIDs to Zabbix Template XML

          -f, --filename=PATH output filename (default: stdout)

          -N, --name=STRING template name (default: OID label)
          -G, --group=STRING template group (default: 'Templates')
          -e, --enable-items enable all template items (default: disabled)

          -o, --oid=STRING OID tree root to export

          -v, --snmpver=1|2|3 SNMP version (default: 2)
          -p, --port=PORT SNMP UDP port number (default: 161)

          SNMP Version 1 or 2c specific

          -c, --community=STRING SNMP community string (default: 'public')

          SNMP Version 3 specific

          -L, --level=LEVEL security level (noAuthNoPriv|authNoPriv|authPriv)
          -n, --context=CONTEXT context name
          -u, --username=USERNAME security name
          -a, --auth=PROTOCOL authentication protocol (MD5|SHA)
          -A, --authpass=PASSPHRASE authentication protocol passphrase
          -x, --privacy=PROTOCOL privacy protocol (DES|AES)
          -X, --privpass=PASSPHRASE privacy passphrase

          Zabbix item configuration

          --check-delay=SECONDS check interval in seconds (default: 60)
          --disc-delay=SECONDS discovery interval in seconds (default: 3600)
          --history=DAYS history retention in days (default: 7)
          --trends=DAYS trends retention in days (default: 365)

          -h, --help print this message



          Where I am wrong?


          Who can tell me how can I write manually template for Zabbix form mib file?


          I see scripts and snmp builder they don't work..

          I want to learn how to write templates manually OID by OID

          Thanks.

          Last edited by Taner; 09-04-2018, 18:58.

          Comment


          • Atsushi
            Atsushi commented
            Editing a comment
            Instead of commenting out the target line when an error is output please install the necessary module.
            For example, the following message requires a Perl module called Date/Format.pm.

            Can't locate Date/Format.pm in @INC (you may need to install the Date::Format module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.22.1 /usr/local/share/perl/5.22.1 /usr/lib/x86_64-linux-gnu/perl5/5.22 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.22 /usr/share/perl/5.22 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at ./mib2template.pl line 8.

            If it is CentOS 7, it is in the package called perl-TimeDate.
            Similarly, if it is CentOS 7, you can run mib2template.pl by installing some packages as follows.

            # yum install net-snmp-perl
            # yum install perl-XML-LibXML
            # yum install epel-release
            # yum install perl-Log-Log4perl
            # yum install perl-Capture-Tiny

            Also, please specify the module of the argument of mib2template.pl as follows.

            $ ./mib2template.pl --module MIKROTIK-MIB --root .1.3.6.1.4.1.14988 --group Templates > template.xml
        • Taner
          Member
          • Apr 2018
          • 47

          #7
          Hi, thank you, I will build now Cent OS 7 in VMWARE ESXI 5.5, and I will start to build Zabbix in Cent OS 7.

          Now I am with Ubuntu based Zabbix Appliance latest version from Zabbix web site, and I am with these errors of perl script.


          I have a question, this --module MIKROTIK-MIB from where you take it?

          Comment


          • Atsushi
            Atsushi commented
            Editing a comment
            It is in the first line of file Mikrotik.mib.
        • Taner
          Member
          • Apr 2018
          • 47

          #8
          Thank you Atsushi.

          I installed CentOS 7.
          I installed snmp tools.
          I installed perl components.
          And now I can generate from MIB files XML templates for Zabbix without errors!
          Thank you, thank you, thank you!


          Now how can I import in zabbix this xml template and how can I use it for Mikrotik host?

          I imported it successfully.

          But when I try to add template to Mikrotik Host I see error:
          • Cannot find host interface on "MT01" for item key "mtxrDnStatTable".

            I fix this error with enabling snmp interface.

            And template work but I don't see items and graphics for interfaces of Mikrotik in this generated template from mib.


            Okay, now I can generate xml from Mikrotik,mib file.


            But how can I do it with Juniper enterprise mib files?
            They are in .txt not in .mib file extension.


            For example mib-jnx-ip-capability.txt

            When I try to run :

            snmptranslate -m /usr/share/snmp/mibs/JuniperMibs/mib-jnx-ip-capability.txt -Tz | egrep '"1\.3\.6\.1\.4\.1\.[0-9]+"'

            The result is:

            MIB search path: /root/.snmp/mibs:/usr/share/snmp/mibs
            Cannot find module (JUNIPER-SMI): At line 17 in /usr/share/snmp/mibs/JuniperMibs/mib-jnx-ip-capability.txt
            Did not find 'jnxAgentCapability' in module #-1 (/usr/share/snmp/mibs/JuniperMibs/mib-jnx-ip-capability.txt)
            Unlinked OID in JNX-IP-CAPABILITY: jnxIpCapability ::= { jnxAgentCapability 3 }
            Undefined identifier: jnxAgentCapability near line 20 of /usr/share/snmp/mibs/JuniperMibs/mib-jnx-ip-capability.txt
            Cannot adopt OID in JNX-IP-CAPABILITY: jnxIpCapability ::= { jnxAgentCapability 3 }
            Cannot adopt OID in JNX-IP-CAPABILITY: jnxIpCapJunos ::= { jnxIpCapability 1 }



            I move all mib.txt files of Juniper to /usr/share/snmp/mibs/

            When I run:
            snmptranslate -m /usr/share/snmp/mibs/mib-jnx-fabric-chassis.txt -Tz | egrep '"1\.3\.6\.1\.4\.1\.[0-9]+"'

            The result is:
            "juniperMIB" "1.3.6.1.4.1.2636"



            Now I run :
            ./mib2template.pl --module JUNIPER-FABRIC-CHASSIS --root 1.3.6.1.4.1.2636 --group Templates > mib-jnx-fabric-chassis.xml

            And the result is:
            2018-04-11 13:44:14 WARN> Parent OID .1.3.6.1.4.1.2636 belongs to JUNIPER-SMI, which isn't among the ones specified with --module option


            Why with Juniper Mib files I cant generate xml template?
          Last edited by Taner; 11-04-2018, 12:43.

          Comment

          • grmnrvs
            Member
            • Jun 2018
            • 35

            #9
            Originally posted by Taner
            Thank you Atsushi.

            I installed CentOS 7.
            I installed snmp tools.
            I installed perl components.
            And now I can generate from MIB files XML templates for Zabbix without errors!
            Thank you, thank you, thank you!


            Now how can I import in zabbix this xml template and how can I use it for Mikrotik host?

            I imported it successfully.

            But when I try to add template to Mikrotik Host I see error:
            • Cannot find host interface on "MT01" for item key "mtxrDnStatTable".

              I fix this error with enabling snmp interface.

              And template work but I don't see items and graphics for interfaces of Mikrotik in this generated template from mib.


              Okay, now I can generate xml from Mikrotik,mib file.


              But how can I do it with Juniper enterprise mib files?
              They are in .txt not in .mib file extension.


              For example mib-jnx-ip-capability.txt

              When I try to run :

              snmptranslate -m /usr/share/snmp/mibs/JuniperMibs/mib-jnx-ip-capability.txt -Tz | egrep '"1\.3\.6\.1\.4\.1\.[0-9]+"'

              The result is:

              MIB search path: /root/.snmp/mibs:/usr/share/snmp/mibs
              Cannot find module (JUNIPER-SMI): At line 17 in /usr/share/snmp/mibs/JuniperMibs/mib-jnx-ip-capability.txt
              Did not find 'jnxAgentCapability' in module #-1 (/usr/share/snmp/mibs/JuniperMibs/mib-jnx-ip-capability.txt)
              Unlinked OID in JNX-IP-CAPABILITY: jnxIpCapability ::= { jnxAgentCapability 3 }
              Undefined identifier: jnxAgentCapability near line 20 of /usr/share/snmp/mibs/JuniperMibs/mib-jnx-ip-capability.txt
              Cannot adopt OID in JNX-IP-CAPABILITY: jnxIpCapability ::= { jnxAgentCapability 3 }
              Cannot adopt OID in JNX-IP-CAPABILITY: jnxIpCapJunos ::= { jnxIpCapability 1 }



              I move all mib.txt files of Juniper to /usr/share/snmp/mibs/

              When I run:
              snmptranslate -m /usr/share/snmp/mibs/mib-jnx-fabric-chassis.txt -Tz | egrep '"1\.3\.6\.1\.4\.1\.[0-9]+"'

              The result is:
              "juniperMIB" "1.3.6.1.4.1.2636"



              Now I run :
              ./mib2template.pl --module JUNIPER-FABRIC-CHASSIS --root 1.3.6.1.4.1.2636 --group Templates > mib-jnx-fabric-chassis.xml

              And the result is:
              2018-04-11 13:44:14 WARN> Parent OID .1.3.6.1.4.1.2636 belongs to JUNIPER-SMI, which isn't among the ones specified with --module option


              Why with Juniper Mib files I cant generate xml template?
            Hi, Taner i give the same error with another MIB that i need export to XML, can you resolve this error?

            2018-04-11 13:44:14 WARN> Parent OID .1.3.6.1.4.1.2636 belongs to JUNIPER-SMI, which isn't among the ones specified with --module option

            Comment

            • polpan
              Junior Member
              • Jan 2019
              • 5

              #10
              Originally posted by greavette
              Hello,

              I didn't want to hijack this thread - https://www.zabbix.com/forum/showthread.php?t=49982 as the OP seemed to have things worked out.

              But the above thread did lead me in the direction I want to go in that I need to use a script called mib2template...but I need some help with understanding what I need to do.

              I have a NAS device from Imation and they provide an MIB file which I've downloaded to my PC.

              1. Where do I get the root OID from? I've logged into our Zabbix Server and issued the following command - snmpwalk -v 2c -c public <host IP> (where I used the IP of our NAS). The second line in the results of issuing snmpwalk has this:
              iso.3.6.1.2.1.1.2.0 = OID: iso.3.6.1.4.1.7933.1.10
              Is this my root OID?

              2. Do I move the .MIB file I've downloaded to my Zabbix Server and run the mib2template script? What is output from this script?

              3. What are the next steps to creating the template in Zabbix once I've run themib2template script? Do I go back into the Zabbix Web GUI and create a new template and name it whatever I wan?

              Thank you in advance for any direction you can provide.
              Hi,

              Does running the snmpwalk command will generate or create an .MIB file? thanks..

              Comment


              • Leandro Goethals
                Leandro Goethals commented
                Editing a comment
                No that get the values from ur target machine kinda like an snmpget loop but for the whole mib
            • Leandro Goethals
              Junior Member
              • Mar 2021
              • 5

              #11
              I would like to recommend u guys this:https://github.com/Sean-Bradley/SNMP2ZABBIX ,works like a charm for me and is better documented

              Comment

              Working...