Ad Widget

Collapse

SNMP item based on another item

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • yau
    Junior Member
    • Dec 2023
    • 16

    #1

    SNMP item based on another item

    I try to find a solution for the following:
    Get the upload port for Switches.

    what I already achieved:
    1. Get information about upload port from ARP table:
    discovery rule:
    Code:
    discovery[{#UPLINKMAC},.1.3.6.1.2.1.4.22.1.2]
    2. Get MAC Address as Element prototype:
    Code:
    .1.3.6.1.2.1.4.22.1.2.{#SNMPINDEX}
    Unfortunately the OID .1.3.6.1.2.1.4.22.1.1 gives the VLAN and not the port number.

    The port nuber can be found at the translation table .1.3.6.1.2.1.17.4.3.1.2.<Uplink MAC as Dec>

    3. I alredy transformed the MAC into decimals by a depending item and a javascript
    Uplink MAC as Dec:
    Code:
    some js code

    Can I create an SNMP item, which uses the value of the Item .1.3.6.1.2.1.17.4.3.1.2.<Uplink MAC as Dec> ?
    Example for MAC 01 02 03 04 05 06: .1.3.6.1.2.1.17.4.3.1.2.1.2.3.4.5.6 = INTEGER: 26

    Or any other idea, how to get the number of the uplink port?​
  • MrLoop
    Junior Member
    • May 2023
    • 3

    #2
    Hello, in this case, the OID is directly linked to the device, so it is not possible to create an OID on it unless you have access to the device code. What you can do is to identify better is to use snmpwalk.

    On the same zabbix server, install snmp:

    (Debian)
    apt-get install snmp snmpd

    (RedHat)
    yum install snmp

    Run the snmp command to see how it is:

    snmpwalk -c public -v2c device_ip

    Confirme que você terá resultados SNMP

    Instalar o snmp downloader

    (Debian)

    apt-get instalar snmp-mib-downloader

    SNMPWALK -C Público -V2C device_ip



    Este pacote snmp-mibs-downloader traduz as identificações para você, permitindo uma leitura mais dinâmica. Talvez isso o ajude a chegar onde deseja.​

    Comment

    • yau
      Junior Member
      • Dec 2023
      • 16

      #3
      Thx for the proposal. I would avoid, to run on the zabbix server several hundred snmpwalk requests per period by script. Any other idea?

      Comment

      • MrLoop
        Junior Member
        • May 2023
        • 3

        #4
        You can do the SNMP with "grep" argument to do

        Example:

        snmpwalk -c public -v 2c host_ip | grep number_of_OID

        Comment

        • icycler1
          Junior Member
          • Aug 2024
          • 3

          #5
          I achieved something very similar to this by getting the Mac address to interface assignment for all connected devices.
          See the following post: https://www.zabbix.com/forum/zabbix-...s-and-switches.

          You can likely apply the same logic under the scope of just the uplink ports listed by CDP neighbors or LLDP info rather than the whole mac address table.

          In a different solution I have,
          For just getting the distant end Interface leading to my switch I do a preprocessing step of snmp walk value: 1.3.6.1.4.1.9.9.23.1.2.1.1.7.{#SNMPINDEX}.

          Eventually my goal is to combine my two solutions and maintain a dashboard that I can search a mac address and immediately list its interface, as well as list all uplink and downlink ports.

          Comment

          Working...