Ad Widget

Collapse

TIE MAC Address to Switchport

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Evan.Anderson
    Member
    • Jun 2009
    • 42

    #1

    TIE MAC Address to Switchport

    The question is, has anyone attempted to tie a mac address from SNMPv2-SMI::mib-2.17.4.3.1.1.0.0 to a Switchport?

    Here are pieces of my walks to tie it back to the switchport:

    SNMPv2-SMI::mib-2.17.4.3.1.1.0.0.133.54.202.111 = Hex-STRING: 00 00 85 36 CA 6F
    SNMPv2-SMI::mib-2.17.4.3.1.2.0.0.133.54.202.111 = INTEGER: 45
    SNMPv2-SMI::mib-2.17.1.4.1.2.45 = INTEGER: 10041
    IF-MIB::ifName.10041 = STRING: Fa1/0/41

    So From these walks, I know that this device(00 00 85 36 CA 6F) is plugged into this port Fa1/0/41.

    I currently have a template set up like this:
    Description up Key Update interval History Trends Type Status Applications Error
    Fa 1/0/01-1-Desc ifAlias.10001 86400 30 0 SNMPv2 agent Active - -
    Fa 1/0/01-2-Speed ifSpeed.10001 86400 30 365 SNMPv2 agent Active - -
    Fa 1/0/01-3-Duplex ifduplex.10001 86400 90 0 SNMPv2 agent Active - -
    Fa 1/0/01-4-Admin Status ifadmin.10001 3600 90 365 SNMPv2 agent Active - -
    Fa 1/0/01-5-Status ifoper.10001 60 90 365 SNMPv2 agent Active - -

    Sorry about the formatting if it doesn't look good.
    and I would like to add:
    Fa 1/0/01-6-MAC Address ....somehow, anyone got any ideas? It seems like a lot of decision making and maybe this is not possible...
  • Evan.Anderson
    Member
    • Jun 2009
    • 42

    #2
    I'm thinking a script would be needed...not sure how to create it though...

    Comment

    • Evan.Anderson
      Member
      • Jun 2009
      • 42

      #3
      Perhaps a database monitor item. This looks like it performs sql queries on the database. Is it possible to query the database to acheive the desired result? I don't have database experience, could someone lend a hand it forming the query?

      Comment

      • MrKen
        Senior Member
        • Oct 2008
        • 652

        #4
        Not really sure if this is what you want, but it works.

        Create item -
        Description: MAC Address
        Type: SNMPv2 agent
        SNMP community: yourcommunity
        SNMP OID: .1.3.6.1.2.1.17.4.3.1.1.0.0.133.54.202.111
        SNMP port: 161Key: dot1dTpFdbAddress.0.0.133.54.202.111
        Type of info: Character
        etc.

        MrKen
        Disclaimer: All of the above is pure speculation.

        Comment

        • Evan.Anderson
          Member
          • Jun 2009
          • 42

          #5
          Looking for help from someone with experience in snmptrapd configuration. I found this on the web:

          interface FastEthernet0/24
          snmp trap mac-notification added
          !
          snmp-server enable traps MAC-Notification
          snmp-server host 187.1.3.100 CISCOTRAP MAC-Notification
          mac-address-table notification

          it will send a trap to the remote server which looks like this:

          MAC Changed Message :
          Operation: Added Vlan: 28 MAC Addr: 0060.7015.ac7a Dot1dBasePort: 24

          This is what I want so that I can parse this info and add it to my interfaces in zabbix. Has anyone used snmptrapd with zabbix?

          Comment

          • Evan.Anderson
            Member
            • Jun 2009
            • 42

            #6
            Okay, I'm getting data via snmptrapd, but it doesn't show up in the zabbix server. Where should I look to figure this out. I was getting this:
            /home/ZABBIX/bin/snmptrap.pl: line 22: use: command not found
            /home/ZABBIX/bin/snmptrap.pl: line 23: use: command not found
            /home/ZABBIX/bin/snmptrap.pl: line 29: =: command not found
            /home/ZABBIX/bin/snmptrap.pl: line 34: =: command not found
            /home/ZABBIX/bin/snmptrap.pl: line 35: =: command not found
            /home/ZABBIX/bin/snmptrap.pl: line 36: =: command not found
            /home/ZABBIX/bin/snmptrap.pl: line 40: =: command not found
            /home/ZABBIX/bin/snmptrap.pl: line 41: =: command not found
            /home/ZABBIX/bin/snmptrap.pl: line 59: =: command not found
            /home/ZABBIX/bin/snmptrap.pl: line 60: =: command not found
            /home/ZABBIX/bin/snmptrap.pl: line 64: =: command not found
            /home/ZABBIX/bin/snmptrap.pl: line 65: =: command not found
            /home/ZABBIX/bin/snmptrap.pl: line 73: syntax error near unexpected token `{'
            /home/ZABBIX/bin/snmptrap.pl: line 73: `if ($mapping_method eq "hostname_nonfqdn") {'

            and realized my error. I pointed it to perl and now I'm getting:

            2009-07-28 10:15:05 hostname [*.*.*.*] (via UDP: [*.*.*.*]:34484->[*.*.*.*]) TRAP, SNMP v1, community public SNMPv2-MIB::warmStart.0.0 Cold Start Trap (0) Uptime: 0:00:00.00

            which is good, but I don't see anything in zabbix. I created a host to match, but maybe I don't understand how it get's into zabbix. I used zabbix trapper item

            added *.*.*.* to the allowed hosts, I've tried type of information log, text, and character and nothing shows up. What am I doing wrong?

            Comment

            • Evan.Anderson
              Member
              • Jun 2009
              • 42

              #7
              What is the current method for handling snmptrapd traphandle? I've got it mostly working with snmptrap.pl, but on some threads, I've seen a snmptrap.sh. I want to know to make sure than I'm in line with current standards.

              I found that my switch "opens up" a new mib when mac-address-table notification is enabled. SNMPv2-SMI::enterprises.9.9.215.1.1.8.1.2.0. So I'm going to work with this mib rather than have the switch send a trap.

              SNMPv2-SMI::enterprises.9.9.215.1.1.8.1.2.0 = Hex-STRING: 01 00 65 00 0B CD 9D 24 8D 00 14 00
              Italic is the interface the mac was learned on
              Underline is the mac itself
              Bold is the interface index the mac was learned on...in hex of course.

              So, now I have the data that I want. How can I achieve my end result. I'd like to be able to pull out the underline(mac) piece and store it into another item...Help

              And then I'd like to take the bold(port index in hex) change it to decimal and use it to determine which item the mac should be stored in.

              So for instance 14 hex in decimal is 20 and SNMPv2-SMI::mib-2.17.1.4.1.2.20 = INTEGER: 10018 so I'd like to update and item fa 1/0/18: mac = 00 0B CD 9D 24 8D

              Can a trigger be used to pulled the required pieces of the string out and do what I'd like?

              Comment

              Working...