Ad Widget

Collapse

Create SNMP-enabled Items Automatically in Zabbix Server

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • m.amran
    Junior Member
    • Nov 2022
    • 9

    #1

    Create SNMP-enabled Items Automatically in Zabbix Server

    Hi Team,

    I am new to Zabbix and I need your kind support.
    I have a device connected to Zabbix server and want to create items automatically in Zabbix server for any SNMP-enabled Items which start with .1.3.6.1.4.1.29631.2.2.0.256.xxxx
    as shown in the attached snapshots.
    Attached Files
  • markfree
    Senior Member
    • Apr 2019
    • 868

    #2
    It seems your best bet is to use Discovery of SNMP OIDs.

    Comment

    • m.amran
      Junior Member
      • Nov 2022
      • 9

      #3
      Thank you markfree for your response
      I don't know what object ID to put in the SNMP OID. Can you please clarify
      Attached Files

      Comment

      • markfree
        Senior Member
        • Apr 2019
        • 868

        #4
        I'm unable to reproduce the same items you have.

        Reading from your OIDs, I believe your discovery item would be something like this:

        Code:
        discovery[{#CAPS},1.3.6.1.4.1.29631.2.2.0.256.59272,{#SESSION_TIME},1.3.6.1.4.1.29631.2.2.0.256.59280]
        It is pretty much a Key,value pair.

        The resulting entities are a JSON structure which you can use to create item prototypes.

        Test it out over there and post the results.

        Comment

        • m.amran
          Junior Member
          • Nov 2022
          • 9

          #5
          I have tested your concept and it is good for two items (59272 & 59280) but the problem is that ,there are a lot of items (more than 1000 items) in the 1.3.6.1.4.1.29631.2.2.0.256.xxxx.
          and I want the items name to be generated from 1.3.6.1.4.1.29631.2.2.0.256.xxxx.1.0 and the SNMP OID value to be generated from 1.3.6.1.4.1.29631.2.2.0.256.xxxx.7.0
          so how is the discovery rule going to be?. your kind cooperation is highly appreciated.​

          Comment

          • markfree
            Senior Member
            • Apr 2019
            • 868

            #6
            Does XXXX mean a sequence bigger than 1000?

            Zabbix documentation says that "the discovered entities are grouped by {#SNMPINDEX} macro value".
            What I understand from SNMP LLD is that the index is sort of appended to the end of an OID.
            Therefore, it can only "walk" the provided OID subtree.
            I guess it is not possible to change part of the OID besides the index itself.

            If you remove the last number from your discovery, stopping at 256, you would find all values under it.
            Considering the amount of values for XXXX and the previous SNMPWalk you attached, that would give 15 * XXXX. That could be a big JSON.

            Under those values, you can try to use JSONPath to extract the required "name" and "value".

            Try it out and show us the result.

            Comment

            • m.amran
              Junior Member
              • Nov 2022
              • 9

              #7
              Hello,
              I used the SNMP OID discovery[{#CAPS},1.3.6.1.4.1.29631.2.2.0.256] and got a very big JSON as you expected. Then I tried a lot to use JSONPath to extract the required "name" and "value" but I couldn't get any result.
              Can you please help how to use JSONPath?
              Attached Files

              Comment

              • markfree
                Senior Member
                • Apr 2019
                • 868

                #8
                Please, take a look at Low Level Discovery documentation.

                There you can find LLD macro configurations that will aid you in building item and trigger prototypes.

                Also, check out the JSONPath documentation as it might be helpful in your macro configuration.

                Comment

                • m.amran
                  Junior Member
                  • Nov 2022
                  • 9

                  #9
                  Hello dear,
                  Happy new year.
                  please note that the discovery has been created successfully. However, for some snmp OIDs where there are many objects, I got a connection timeout error as in the attached snapshot.
                  please your kind help to overcome this issue.
                  Attached Files

                  Comment

                  • m.amran
                    Junior Member
                    • Nov 2022
                    • 9

                    #10
                    Can you please help?

                    Comment

                    • markfree
                      Senior Member
                      • Apr 2019
                      • 868

                      #11
                      After creating your discovery item, try to test it with the frontend test option.
                      It should display the raw JSON.

                      Save that data to a file, then use JQ tool to test your JSONPath filter.

                      Comment

                      Working...