Ad Widget

Collapse

Need to get an OID number which match an output.

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • MikeJensen
    Junior Member
    • Apr 2024
    • 19

    #1

    Need to get an OID number which match an output.

    Hello Zabbix forums
    I'm creating a new discovery rule that looks like this:
    discover[{#WLANNAME},1.3.6.1.4.1.9.9.512.1.1.1.1.3,{#NUMBER OFCLIENTS},1.3.6.1.4.1.14179.2.1.1.1.38]

    The {#WLANNAME},1.3.6.1.4.1.9.9.512.1.1.1.1.3 gives me an output of a string:
    snmpwalk -v 2c -c public <IP> 1.3.6.1.4.1.9.9.512.1.1.1.1.3
    SNMPv2-SMI::enterprises.9.9.512.1.1.1.1.3.1 = STRING: "WLAN1"
    SNMPv2-SMI::enterprises.9.9.512.1.1.1.1.3.3 = STRING: "WLAN2"
    SNMPv2-SMI::enterprises.9.9.512.1.1.1.1.3.7 = STRING: "WLAN3"

    In my discovery rule i need to get for each WLAN the count of connected users on the WLAN.Thats why i have: {#NUMBER OFCLIENTS},1.3.6.1.4.1.14179.2.1.1.1.38:
    snmpwalk -v 2c -c public <IP> 1.3.6.1.4.1.14179.2.1.1.1.38.1
    SNMPv2-SMI::enterprises.14179.2.1.1.1.38.1 = Counter32: 47

    I need to somehow get the number after the OID: 1.3.6.1.4.1.9.9.512.1.1.1.1.3.X and would like it to be "stored" in a macro called {#WLANID}, eg in an item prototype: 1.3.6.1.4.1.14179.2.1.1.1.38.{WLANID}. How can i do this the best way?
    I'm on Zabbix 6.0
  • Answer selected by Markku at 08-07-2024, 10:37.
    Markku
    Senior Member
    Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
    • Sep 2018
    • 1781

    {#SNMPINDEX} LLD macro is automatically created when you use the discover[] item, containing the number you are looking for.

    So instead of 1.3.6.1.4.1.14179.2.1.1.1.38.{WLANID} you can use 1.3.6.1.4.1.14179.2.1.1.1.38.{#SNMPINDEX}​ in your item prototype.

    Markku

    Comment

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

      #2
      {#SNMPINDEX} LLD macro is automatically created when you use the discover[] item, containing the number you are looking for.

      So instead of 1.3.6.1.4.1.14179.2.1.1.1.38.{WLANID} you can use 1.3.6.1.4.1.14179.2.1.1.1.38.{#SNMPINDEX}​ in your item prototype.

      Markku

      Comment

      • MikeJensen
        Junior Member
        • Apr 2024
        • 19

        #3
        Thank you Markku! I now got my template to dynamically discover the WLANs on my Cisco 9800 WLC and also get the connected clients for each of the WLANs!

        Comment

        Working...