Ad Widget

Collapse

Is There a Bug in the Zabbix 6.2 Template Import Routine?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • admin@psmnv.com
    Member
    • May 2022
    • 41

    #1

    Is There a Bug in the Zabbix 6.2 Template Import Routine?

    I'm trying to import some Dell MIBs into Zabbix 6.2. I used Sean Bradley's SMTP2ZABBIX script to convert them to XML. Zabbix said, "Imported successfully," but none of the items that had index numbers (such as Ethernet ports numbers) imported. In the zabbix_server.log, I see lots of errors like these...
    .
    135360:20221207:190120.653 item "sw7r0:.1.3.6.1.2.1.2.2.1.10.[41]" became not supported: No Such Instance currently exists at this OID


    ​Should those brackets be in there?

    If you attempt to query it as shown, it produces an error...
    .
    [root@mgt03 zabbix]# snmpget -v3 -l authPriv -u all-mibs-user -a SHA -A "redacted" -x AES -X "redacted" -On sw7r0 .1.3.6.1.2.1.2.2.1.10.[41]
    .1.3.6.1.2.1.2.2.1.10.[41]: Unknown Object Identifier (Index out of range: [41] (ifIndex))


    ...however, if you remove the brackets from the end, it works...

    ​[root@mgt03 zabbix]# snmpget -v3 -l authPriv -u all-mibs-user -a SHA -A "redacted" -x AES -X "redacted" -On sw7r0 .1.3.6.1.2.1.2.2.1.10.41
    .1.3.6.1.2.1.2.2.1.10.41 = Counter32: 0


    The OID is obviously there in the switch, but for some reason Zabbix is putting brackets around the last part. This makes me feel like there's possibly some kind of bug in the import routine, or there is some problem with the item prototype in the XML code. Basically, nothing in the template that has the variable [{#SNMPINDEX}] imported properly.
    .
    <item_prototype>
    <name>HOST-RESOURCES-MIB::hrStorageType[{#SNMPINDEX}]</name>
    <type>SNMPV2</type>
    <description>The type of storage represented by this entry.</description>
    <applications>
    <application>
    <name>dell-s5248f-on-EtherLike-MIB</name>
    </application>
    </applications>
    <port>{$SNMP_PORT}</port>
    <snmp_community>{$SNMP_COMMUNITY}</snmp_community>
    <key>.1.3.6.1.2.1.25.2.3.1.2.[{#SNMPINDEX}]</key>
    <snmp_oid>.1.3.6.1.2.1.25.2.3.1.2.{#SNMPINDEX}</snmp_oid>
    <delay>1h</delay>
    <history>2w</history>
    <trends>0</trends>

    <value_type>CHAR</value_type>
    </item_prototype>
    Last edited by [email protected]; 10-12-2022, 07:57.
  • Markku
    Senior Member
    Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
    • Sep 2018
    • 1782

    #2
    Can you show us consistent comparison:
    - the item prototype in XML (the one that you import)
    - the item prototype in Zabbix (screenshot, after importing that XML)

    Markku

    Comment

    • admin@psmnv.com
      Member
      • May 2022
      • 41

      #3
      Here is the item prototype in the XML.

      <item_prototype>
      <name>IF-MIB::ifInOctets[{#SNMPINDEX}]</name>
      <type>SNMPV2</type>
      <description>The total number of octets received on the interface, including framing characters. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime.</description>
      <applications>
      <application>
      <name>dell-s5248f-on-EtherLike-MIB</name>
      </application>
      </applications>
      <port>{$SNMP_PORT}</port>
      <snmp_community>{$SNMP_COMMUNITY}</snmp_community>
      <key>.1.3.6.1.2.1.2.2.1.10.[{#SNMPINDEX}]</key>
      <snmp_oid>.1.3.6.1.2.1.2.2.1.10.{#SNMPINDEX}</snmp_oid>
      <delay>1h</delay>
      <history>2w</history>
      <trends>0</trends>
      </item_prototype>​

      Here is the prototype that imported. It looks correct to me.

      Click image for larger version

Name:	image.png
Views:	350
Size:	55.5 KB
ID:	455860

      Here is the error from the zabbix_server log

      135358:20221209:230120.730 item "sw7r0:.1.3.6.1.2.1.2.2.1.10.[41]" became not supported: No Such Instance currently exists at this OID

      Here is me querying it manually....

      [root@mgt03 ~]# snmpget -v3 -l authPriv -u all-mibs-user -a SHA -A "redacted" -x AES -X "redacted" -On sw7r0 .1.3.6.1.2.1.2.2.1.10.41
      .1.3.6.1.2.1.2.2.1.10.41 = Counter32: 0

      Comment

      • admin@psmnv.com
        Member
        • May 2022
        • 41

        #4
        Also, here is the same OID in the "Latest Data" view.

        Click image for larger version

Name:	image.png
Views:	316
Size:	131.4 KB
ID:	455862

        Comment

        • admin@psmnv.com
          Member
          • May 2022
          • 41

          #5
          And here's what happens when I test it,,,

          Click image for larger version

Name:	image.png
Views:	337
Size:	33.7 KB
ID:	455864

          Comment

          • Markku
            Senior Member
            Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
            • Sep 2018
            • 1782

            #6
            I don't see any problem in these screenshots: item key looks fine before and after the import, SNMP OID looks fine in the item prototype.

            Note that it is not possible to test an item prototype. You need to test an actual item on a host.

            About this:

            135358:20221209:230120.730 item "sw7r0:.1.3.6.1.2.1.2.2.1.10.[41]" became not supported: No Such Instance currently exists at this OID
            The item name there (".1.3.6.1.2.1.2.2.1.10.[41]") does not match the item prototype or the list in your screenshot above (like "IF-MIB:xxxx"). It looks like your host sw7r0 has some other (incorrect) items as well, maybe from your previous attempts. You can delete them if that is the case.

            (edit: I messed up something, I shouldn't be reading these on a tablet... let's see again)

            Markku
            Last edited by Markku; 10-12-2022, 09:51.

            Comment

            • admin@psmnv.com
              Member
              • May 2022
              • 41

              #7
              I deleted the old host and created a new one. A different switch. I applied the same template.

              I tested an item, not a prototype, and got this...

              ​​Click image for larger version

Name:	image.png
Views:	303
Size:	31.2 KB
ID:	455868

              The errors in the zabbix_server log still look the same, except you will note that the name of the host has changed from sw7r0 to sw7y0 (different switch).

              135359:20221209:235421.594 item "sw7y0:.1.3.6.1.2.1.31.1.4.1.3.[41]" became not supported: No Such Object available on this agent at this OID
              Attached Files

              Comment

              • admin@psmnv.com
                Member
                • May 2022
                • 41

                #8
                Also, the new host is still not pulling in the data, but I can query it manually from the zabbix server using smpwalk or smpget.

                Click image for larger version

Name:	image.png
Views:	318
Size:	153.7 KB
ID:	455870

                Comment

                • Markku
                  Senior Member
                  Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
                  • Sep 2018
                  • 1782

                  #9
                  Ok so the first thing:

                  The OID is obviously there in the switch, but for some reason Zabbix is putting brackets around the last part.
                  No, that's the item key that has the brackets, that is not the SNMP OID.

                  Then, in my previous message I messed up item name and key, so I believe there are no extra items in your sw7r0 host after all.

                  I don't yet see any problems in the items themselves. Do you have a possibility to temporarily test with SNMP v2c community?

                  Markku

                  Comment

                  • admin@psmnv.com
                    Member
                    • May 2022
                    • 41

                    #10
                    ​Switching to SMNP 2C seems to have convinced it to collect some data, though some items still fail




                    Although it isn't what I'd call accurate. There's no way we're pushing 12 T of data through that 25 G switch. :-)

                    Click image for larger version

Name:	image.png
Views:	331
Size:	102.8 KB
ID:	455873

                    Comment

                    • Markku
                      Senior Member
                      Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
                      • Sep 2018
                      • 1782

                      #11
                      Is the preprocessing rule correctly configured in the item prototype? Change per second + multiplied by 8 (to get octets to bits)

                      Markku

                      Comment

                      • admin@psmnv.com
                        Member
                        • May 2022
                        • 41

                        #12
                        Heck if I know. This is all brand new to me. There are so many parts to the setup!. Why would it need a preprocessing rule if it already knows the interface speed (ifSpeed) from the SNMP query and the other queries are in numbers of octets?

                        Comment

                        • admin@psmnv.com
                          Member
                          • May 2022
                          • 41

                          #13
                          It's 4:00 am here and I better get some sleep. I have to get back up in a couple hours. THANK YOU SO MUCH FOR ALL THE HELP!

                          Comment

                          • Markku
                            Senior Member
                            Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
                            • Sep 2018
                            • 1782

                            #14
                            Ok, you have not selected an easy route Usually it is best to take existing templates for a start. I have understood that the snmp2zabbix conversion tools don't always work correctly.

                            To clarify the preprocessing stuff anyway: ifHCInOctets returns the byte counter value from the switch interface. That is a constantly increasing value (except after switch reboots etc but anyway), not very useful for monitoring. To be able to use it as a bps (bits per second) value you have to process it further. That's what the preprocessing rules (in item prototypes or items) are for. This is how my item prototypes for interface utilization look like:

                            Click image for larger version

Name:	image.png
Views:	340
Size:	11.3 KB
ID:	455878

                            There is a generic SNMP switch template in Zabbix git repository (if you have a new Zabbix installation you should have it as well): https://git.zabbix.com/projects/ZBX/...Frelease%2F6.2

                            If you don't want to use the ready-made templates, you can still see how they look like. I, for one, usually use my own templates, but I look at the standard templates and copy the relevant configurations to my own templates. It's up to the Zabbix admin how it works best with the local needs.

                            About the SNMP v3 vs. v2c thing: now you at least know that the SNMP OIDs and stuff are correct with v2c, so you can start troubleshooting what is wrong with the SNMP v3 configurations in your case.

                            Markku

                            Comment

                            • admin@psmnv.com
                              Member
                              • May 2022
                              • 41

                              #15
                              I did not know how hard this route would be when I started out! The only reason I tried creating my own template was because the built-in ones were not pulling data, so I thought the problem was that the template was incompatible with the Dell S5248F-ON switches.Now that we know there could be an issue with SNMP V3 versus V2C, I will try the default templates again! Thank you for the extra explanation.

                              Comment

                              Working...