Ad Widget

Collapse

SNMP Discovery - Conversion from advsnmp.discovery

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • syntax53
    Member
    • Mar 2018
    • 40

    #1

    SNMP Discovery - Conversion from advsnmp.discovery

    I'm trying to setup monitoring for my Check Point firewall vis SNMP. I found the following template which works for everything but the discovery: https://share.zabbix.com/network_dev...heckpoint-fw-1

    The template mentioned needing the following for advanced snmp discovery: https://github.com/simonkowallik/Zab...snmp.discovery

    However, that was last updated 6 years ago and only mentions Zabbix 2.0. I found a thread started by the author (I believe) here, but everything there is also old: https://www.zabbix.com/forum/zabbix-...ynamic-indexes

    Long story short, the two discovery rules for the template that utilize this plug-in/script are:

    advsnmp.discovery[{HOSTNAME},"-v2c -c{$SNMP_COMMUNITY}",1.3.6.1.4.1.2620.1.5.13.1.2,1. 3]

    and

    advsnmp.discovery[{HOSTNAME},"-v2c -c{$SNMP_COMMUNITY}",1.3.6.1.4.1.2620.1.6.7.5.1.1,1 .3]

    I've got the MIBs imported and snmp all working, but I'm not familiar enough with SNMP OIDs. The documentation under https://www.zabbix.com/documentation...very/snmp_oids is way over my head. Can anyone lend some guidance on how I might convert this? Or does anyone know if this plug-in is compatible with Zabbix 3.4? I saw in the script a mention of them having to change something to deal with zabbix 2.0rc1, so I can only imagine other things have changed in the past 6 years.
  • kloczek
    Senior Member
    • Jun 2006
    • 1771

    #2
    You are trying to use 6 years old stuff for zabbix 2.0.x which is no longer even supported.
    SNMP discovery is now available OOTB.
    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

    • syntax53
      Member
      • Mar 2018
      • 40

      #3
      Originally posted by kloczek
      You are trying to use 6 years old stuff for zabbix 2.0.x which is no longer even supported.
      SNMP discovery is now available OOTB.
      Yes I figured as much, that's the reason I posted. I'm looking for assistance in converting those old discovery rules to new ones.

      Comment

      • kloczek
        Senior Member
        • Jun 2006
        • 1771

        #4
        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

        • syntax53
          Member
          • Mar 2018
          • 40

          #5
          Thank you for taking the time to respond, but I have already listed that exact link in my post mentioning that that page is way over my head at the moment. For starters, it says discovery has been supported since v2.0. If it has been supported since then, then why did someone have to write this additional script. I don't need an answer to that, but seeing that is what adds to the confusion in that maybe this is something different. Secondly, I don't see anything in the examples that takes an OID as its base for discovery as the template I'm looking at seems to be doing.

          Comment

          • kloczek
            Senior Member
            • Jun 2006
            • 1771

            #6
            Just had one more time look on your post.
            I don't see with what you have problem.
            You must use discovery[] key and that is end of the story. To use it you must understand what it does if you want to transform your current advsnmp.discovery[] which you must understand as well.

            You've mentioned as well that you have imported/registered MIBs. Despite this you are using numerical OIDs.
            I have no OIDs db in my head and I have no idea what you are trying to monitor.
            It is quite possible as well that instead trying to maintain some 6y old template more likely you should just try to use some freshen template if you are not familiar with maintaining templates.

            In other words: you are not defining enough well your problem to give you any advice and looks more like you are trying to ask to solve your problems.
            Did you ever try use already discovery[]? Did you check some example templates which are trying to use this key? Did you found any issue/difficulty with using discovery[] key in LLD iterators?
            If not you have standard zabbix templates. If it is not enough you can peak as well on my MIB based templates
            https://github.com/kloczek/zabbix-te...ree/master/MIB
            and devices template which is using those templates:
            https://github.com/kloczek/zabbix-te...SNMP%20Devices
            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

            • syntax53
              Member
              • Mar 2018
              • 40

              #7
              For anyone that lands on this page in the future, I ended up figuring this out on my own. The answer I was looking for and the one that will hopefully help someone in the future is to convert these old discovery rules to new ones, you use a format like this:

              discovery[{#VALUE_ONE}, SNMPv2-MIB::someThing.0, {#VALUE_TWO}, 1.2.3.4.5.6, {#ETC}, ETC]

              So in the case of this example: advsnmp.discovery[{HOSTNAME},"-v2c -c{$SNMP_COMMUNITY}",1.3.6.1.4.1.2620.1.1.25.5.1.2, 1.3] ... If you research "1.3.6.1.4.1.2620.1.1.25.5.1.2" you'll see it is in reference to interface discovery. The "1.3" is specific to advsnmp.discovery and relates to indexing options of the discovered values. In the newer discovery method, it's easier--

              To modify this to zabbix today, you would change the type of check to SNMPv2, and then put a key in (usually use something from the MIB if you can), and then put something like this in the OID:

              discovery[{#IF_INDEX}, IF-MIB::ifIndex, {#IF_DESC}, IF-MIB::ifDescr]

              If you were to do a snmpwalk on "IF-MIB::ifIndex" you would see something like this:

              IF-MIB::ifIndex.1 = INTEGER: 1
              IF-MIB::ifIndex.2 = INTEGER: 2
              IF-MIB::ifIndex.3 = INTEGER: 3
              IF-MIB::ifIndex.4 = INTEGER: 4
              IF-MIB::ifIndex.5 = INTEGER: 5
              IF-MIB::ifIndex.6 = INTEGER: 6
              IF-MIB::ifIndex.7 = INTEGER: 7
              IF-MIB::ifIndex.8 = INTEGER: 8
              IF-MIB::ifIndex.9 = INTEGER: 9

              So the first macro will store the index number of each discovered interface into #IF_INDEX.

              Then if you were to snmpwalk "IF-MIB::ifDescr" (you can also use the OIDs as well) you will see:

              IF-MIB::ifDescr.1 = STRING: lo
              IF-MIB::ifDescr.2 = STRING: eth5
              IF-MIB::ifDescr.3 = STRING: eth1
              IF-MIB::ifDescr.4 = STRING: eth6
              IF-MIB::ifDescr.5 = STRING: eth2
              IF-MIB::ifDescr.6 = STRING: eth7
              IF-MIB::ifDescr.7 = STRING: eth3
              IF-MIB::ifDescr.8 = STRING: Mgmt
              IF-MIB::ifDescr.9 = STRING: eth4

              ... which will get stored into #IF_DESC.

              Then in your item prototypes you reference those macro values from the discovery rule. Example:

              name: Bytes IN - {#IF_DESC}
              type: snmpv2
              key: ifHCInOctets[{#IF_INDEX}]
              oid: IF-MIB::ifHCInOctets.{#IF_INDEX}

              Note that zabbix also provides pre-defined macros for indexing multiple returned snmp values in cases like this. However, since this particular device provides it's own indexing OIDs I prefer to use those.

              p.s. I updated the checkpoint templates I found/used for zabbix 3.4 and uploaded them to the share: https://share.zabbix.com/network_devices/cat-checkpoint
              Last edited by syntax53; 13-05-2018, 17:59.

              Comment

              Working...