Ad Widget

Collapse

Low-level SNMP discovery for the 1.9.4 release

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • simon123
    Junior Member
    • Oct 2010
    • 22

    #1

    Low-level SNMP discovery for the 1.9.4 release

    First of all, let me say: i'm a great fan of this product and love the new low-level discovery feature.

    I was testing the 1.9.4, and would need it almost exclusivly for it's SNMP monitoring capabilities.
    The low-level discovery feature is a great help in deploying and maintaining a large network environment, thumbs up for that one!
    Monitoring storage usage with this feature works like a charm.

    When it comes to monitoring network traffic however, low-level discovery has some restrictions for me. Let me explain by example:

    When we monitor network traffic, we like to make items/graphs/triggers and categorize all items/triggers/graphs with the IP-Adres.
    So it would say something like "Incoming traffic on 192.168.50.1". In previous versions i was able to do this with macro's.

    Here's the kicker: when you use low-level discovery (as described in the manual) the items created can only have either the given name (e.g. eth0) or the index number of the NIC (OID).
    This naming convention is great if you only have a couple of servers and know your way around each of them. For large environments however these item/graph/trigger names would be useless.
    Unless you know what "Intel(R) PRO/1000 MT Network Connection #4" on machine gate02.example.com is connected to by hart.

    A workaround for this would be to use the ipAdEntIfIndex OID (as rule). This produces something like:

    root@zbx-beta:/tmp/zabbix-1.9.4# snmpwalk -v1 -cpublic 172.16.80.151 1.3.6.1.2.1.4.20.1.2
    iso.3.6.1.2.1.4.20.1.2.127.0.0.1 = INTEGER: 1
    iso.3.6.1.2.1.4.20.1.2.172.16.80.151 = INTEGER: 2


    So you could use the index (being the IP-Address) and the value (being the NIC card OID Index) in your prototype item. This would work great except for the fact that the index macro ({#SNMPINDEX}) in this case is only the last digits of the OID (everything following the last point).
    So i get items like: "Incoming traffic on 151" instead of the full IP. It would be great to have an option on choosing wether to use the last part of the OID or use the last 4 parts, as is the case with IPv4 addresses.

    I think that using only the last digits of the OID as a hardcoded option will cause issues for other OID's as well.

    Any ideas on this?
  • richlv
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Oct 2005
    • 3112

    #2
    so that would be more or less ability to choose an arbitrary amount of id segments.
    might be worth adding as a zbxnext, if there's not something similar already
    Zabbix 3.0 Network Monitoring book

    Comment

    • simon123
      Junior Member
      • Oct 2010
      • 22

      #3
      Already created

      Originally posted by richlv
      so that would be more or less ability to choose an arbitrary amount of id segments.
      might be worth adding as a zbxnext, if there's not something similar already
      Yes, I had already created the feature request :



      This would really be an improvement for our distributed Zabbix environment.

      Comment

      • xmaster
        Junior Member
        • Aug 2011
        • 8

        #4
        Need that functionality too!
        When you enter, for example, IP-MIB::ipAdEntAddr, and complete OID is
        IP-MIB::ipAdEntAddr.10.10.10.1, {#SNMPINDEX} should be 10.10.10.1, not just 1.
        Last edited by xmaster; 14-08-2011, 14:05.

        Comment

        • delatbabel
          Junior Member
          • Aug 2011
          • 7

          #5
          I can't find anything in the documentation about auto SNMP registration or low level discovery.

          I have created a discovery rule to attempt to auto discover a host by listing the IP address and the SNMP community name. I have checked that the host has snmp running and I can manually snmpwalk the host from the Zabbix server. However the host never gets registered.

          Does anyone have some URLs of documents describing how to do this?

          Comment

          • zalex_ua
            Senior Member
            Zabbix Certified Trainer
            Zabbix Certified SpecialistZabbix Certified Professional
            • Oct 2009
            • 1286

            #6
            Be careful, Low Lewel Discovery is not the same as the regular network discovery, and it will be available only in the future version 2.0. It's documented here:
            http://www.zabbix.com/documentation/...evel_discovery
            and it is not finished.

            Documentation of the network discovery for the auto-registration is available here:
            http://www.zabbix.com/documentation/...auto-discovery

            Comment

            • jesmit
              Junior Member
              • Feb 2008
              • 20

              #7
              looks like the source is checks_snmp.c

              The only big problem I see is that SNMPINDEX is expected to be a type INT, so the impact of code change may be non-trivial if it is changes to accommodate variable length indexes (ie. strings).

              Comment

              • netmon
                Member
                • Feb 2012
                • 30

                #8
                Take a look at:

                My Addons to the Zabbix Monitoring Solution. Contribute to simonkowallik/Zabbix-Addons development by creating an account on GitHub.


                Code:
                root@zbx-beta:/tmp/zabbix-1.9.4# snmpwalk -v1 -cpublic 172.16.80.151 1.3.6.1.2.1.4.20.1.2 
                iso.3.6.1.2.1.4.20.1.2.127.0.0.1 = INTEGER: 1 
                iso.3.6.1.2.1.4.20.1.2.172.16.80.151 = INTEGER: 2
                You can use advsnmp.discovery for that.

                advsnmp.discovery[{HOST.IP},"-v1 -cpublic",.1.3.6.1.2.1.4.20.1.2,1.4]
                This will give you:
                Code:
                {#ADVSNMPINDEX1} => 127.0.0.1          {#ADVSNMPVALUE} => 1
                {#ADVSNMPINDEX1} => 172.16.80.151      {#ADVSNMPVALUE} => 2

                Comment

                • jesmit
                  Junior Member
                  • Feb 2008
                  • 20

                  #9
                  This works great. Thanks!

                  I had to make one small change..

                  133 # Remove any double quotes from $value
                  134 $value =~ tr/"//d;
                  135 $INDEXES{$line_index} = $value;
                  136 # put generated line index into @indexes


                  Turns out my snmpvalues had double quotes in them already and it was being interpreted as an empty value. I'm not 100% sure if the code above is the best approach or if the quotes should be escaped instead. Just off the top of my head it should not matter.

                  -j

                  Comment

                  • netmon
                    Member
                    • Feb 2012
                    • 30

                    #10
                    jesmit, thanks for the info.

                    Added. :-)

                    Comment

                    • jesmit
                      Junior Member
                      • Feb 2008
                      • 20

                      #11
                      I'm hoping someone can help me. I've upgraded to 2.0rc1

                      I am now getting "Value should be JSON object" error messages.

                      I've modified the script to conform to the new notation and it looks like the following;



                      {
                      "data":[

                      {
                      "{#ADVSNMPINDEX1}":"1",
                      "{#ADVSNMPVALUE}":"fw-1"
                      },
                      {
                      "{#ADVSNMPINDEX1}":"10",
                      "{#ADVSNMPVALUE}":"fw-P"
                      },
                      {
                      "{#ADVSNMPINDEX1}":"11",
                      "{#ADVSNMPVALUE}":"fw-E"
                      },
                      {
                      "{#ADVSNMPINDEX1}":"12",
                      "{#ADVSNMPVALUE}":"fw-C"
                      },
                      {
                      "{#ADVSNMPINDEX1}":"13",
                      "{#ADVSNMPVALUE}":"fw-S"
                      },
                      {
                      "{#ADVSNMPINDEX1}":"14",
                      "{#ADVSNMPVALUE}":"fw-I"
                      },
                      {
                      "{#ADVSNMPINDEX1}":"15",
                      "{#ADVSNMPVALUE}":"fw-D"
                      }

                      ]
                      }


                      ---

                      Just wondering if someone can spot anything obvious..

                      Thanks.

                      -j

                      Comment

                      • netmon
                        Member
                        • Feb 2012
                        • 30

                        #12
                        Hi jesmit,

                        2.0.0rc1 is a very fresh release. But, as you, I'm also living on the edge. ;-)

                        Checkout Version 1.3 of advsnmp.discovery.
                        My Addons to the Zabbix Monitoring Solution. Contribute to simonkowallik/Zabbix-Addons development by creating an account on GitHub.

                        Comment

                        • zalex_ua
                          Senior Member
                          Zabbix Certified Trainer
                          Zabbix Certified SpecialistZabbix Certified Professional
                          • Oct 2009
                          • 1286

                          #13
                          I'm on that edge already three years

                          Comment

                          • jesmit
                            Junior Member
                            • Feb 2008
                            • 20

                            #14
                            Thanks netmon.

                            Unfortunately I'm still getting the error. Are you at 2.0rc1 yet and have it working? Just curious if this is just something that I did (compile problem or something) or if it is a bug.

                            -j

                            Comment

                            • netmon
                              Member
                              • Feb 2012
                              • 30

                              #15
                              I'm running v2.0.0rc2 (revision 26135).
                              The JSON you posted is valid. Maybe you try with rc2?

                              Comment

                              Working...