[patch] Track devices on Cisco etherchannel interfaces

Support questions about the MAC Track plugin

Moderators: Moderators, Developers

Post Reply
Author
Message
matej_v
Posts: 29
Joined: Thu Feb 12, 2009 3:02 pm
Location: Slovenia

[patch] Track devices on Cisco etherchannel interfaces

#1 Post by matej_v » Wed Mar 31, 2010 2:36 pm

Hi all!

First of a big thank you to TheWitness for this excellent plugin. It has saved us a lot of time tracking down machines in our network.

We have a lot of VMWare hosts to which we run etherchannel (802.3ad) from Cisco switches. Because the ifType of Port-channel interfaces is 53 and thus invisible to mactrack, I created this patch to be able to track devices connected to port-channel interfaces.

Unfortunately Cisco also uses ifType 53 for other interface types, so I had to detect Port-channel interfaces by their name (Po<number>). This meant an especially ugly change in get_base_dot1dTpFdbEntry_ports. If somebody comes up with a better idea I would like to hear it.

I don't know if there is any demand for monitoring etherchannel, but if there is, maybe this patch could be integrated into official mactrack sources.
Attachments
mactrack_cisco_etherchannel.patch
Track devices on Port-channel ifaces. Apply against SVN rev 834
(2.65 KiB) Downloaded 242 times

User avatar
TheWitness
Developer
Posts: 14804
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

#2 Post by TheWitness » Wed Mar 31, 2010 4:40 pm

Can you please open a bug here: http://bugs.cacti.net under the Plugins Section and I will incorporate?

Thanks,

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Central Plugin Repository
Central Templates Repository


I'm still out there people. Getting excited for Cacti 1.2. I think it will be a great release.

matej_v
Posts: 29
Joined: Thu Feb 12, 2009 3:02 pm
Location: Slovenia

#3 Post by matej_v » Thu Apr 01, 2010 6:04 am

TheWitness wrote:Can you please open a bug here: http://bugs.cacti.net under the Plugins Section and I will incorporate?
Done: http://bugs.cacti.net/view.php?id=1666

There is another more radical modification we made to mactrack, that may be of interest.

Current end port detection is based on detecting trunk/non trunk ports. Since we run multiple VLANs to a lot of VMWare host machines this just didn't work for us. Also manually setting up ignored ports for each switch is not very scalable (and harder to automate).

So I changed end port detection to compare port desctiption (ifAlias) to a list of names of other mactrack devices. If there is a match, the port is assumed to be connected to another switch and its MAC addressed are ignored. I don't know what other people put in their port descriptions, so I'm not sure if it would make sense for other people to use.

The patch in its current state is not quite ready for production use, however if there is interest, I could work on it a bit. Currently works only on Cisco and Dell switches since that is what we use.

Also, perhaps end port detection method could be made configurable and other methods could be added.
Attachments
mactrack_alt_end_port_detection.patch
Alternative end port detection. Apply mactrack_cisco_etherchannel.patch first.
(5.18 KiB) Downloaded 398 times

toe_cutter
Cacti User
Posts: 168
Joined: Fri Sep 12, 2008 2:41 am
Location: Sweden

#4 Post by toe_cutter » Thu Apr 01, 2010 6:41 am

The previos company i worked at had the socket-id to where the port was patched in their port description. This was on a 15000 port network.

Where im currently at were aiming to do the same basically.

I had a long post of why we do this but i dont think its needed, kinda felt like "my way is the RIGHT way!" :P

Maybe as an option that has to be activated? Per site or per device? Also maybe the possibility to use prefixes or suffixes? My first employer above used the prefixes 'c' and 'x', client and x-connection (mainly between core, dist and switch) respectively.

monitoringisfuncr
Posts: 11
Joined: Wed Dec 07, 2016 11:25 am

Re: [patch] Track devices on Cisco etherchannel interfaces

#5 Post by monitoringisfuncr » Thu Jun 01, 2017 2:57 pm

I made the changes to the mactrack_cisco.php and mactrack_functions.php files as the link suggested. Removing ( - ) the lines and Adding ( + ) lines as the update script suggested and now I get port channel information back for Catalyst / IOS devices which is great, however I still don't get back Cisco Nexus port-channel information which is the bulk of what I need to get back. Any chance you know what would be different with Cisco Nexus port channels vs Catalyst / IOS port channels with regards to those files ?

monitoringisfuncr
Posts: 11
Joined: Wed Dec 07, 2016 11:25 am

Re: [patch] Track devices on Cisco etherchannel interfaces

#6 Post by monitoringisfuncr » Thu Jun 01, 2017 3:52 pm

I think I see the problem.... Per the Patch / Script ( mactrack_cisco_etherchannel.patch ) it looks for matches with : Po# ( preg_match("/^Po\d/" ) , then populates MAC Track results. See the difference between how MACTrack sees the Cat/IOS port channels ( ifName ) VS Nexus port channels via my screenshot. How do I edit the mactrack_cisco.php and mactrack_functions.php files to be able to display BOTH the Cat/IOS port channels ( as it is currently working great ) , but ALSO display the Nexus port channels ? ( Assuming I need an OR in the logic , but don't know enough about the code to write that in ). Follow ?


How the Cat/IOS ifNames are for Port-Channels : ( ifName follows scheme Po## )

mysql> select site_id, device_id, ifIndex, ifName, ifAlias, ifDescr, ifType from mac_track_interfaces where device_id=1 AND ifType=53;
+---------+-----------+---------+-----------+------------------------------------------------+--------------------+--------+
| site_id | device_id | ifIndex | ifName | ifAlias | ifDescr | ifType |
+---------+-----------+---------+-----------+------------------------------------------------+--------------------+--------+
| 1 | 1 | 212 | Po11 | Rack 1A-1 | Port-channel11 | 53 |
| 1 | 1 | 213 | Po12 | Rack 1A-2 | Port-channel12 | 53 |



How the Nexus ifNames are for Port-Channels : ( ifName follows scheme port-channel## )

mysql> select site_id, device_id, ifIndex, ifName, ifAlias, ifDescr, ifType from mac_track_interfaces where device_id=16 AND ifType=53;
+---------+-----------+-----------+------------------+-----------------------------+------------------+--------+
| site_id | device_id | ifIndex | ifName | ifAlias | ifDescr | ifType |
+---------+-----------+-----------+------------------+-----------------------------+------------------+--------+
| 6 | 16 | 369098753 | port-channel2 | tor-dc-oob-sw | port-channel2 | 53 |
| 6 | 16 | 369099752 | port-channel1001 | torinfesx01 | port-channel1001 | 53 |
Attachments
MAC Track SQL Query Difference Between Cat IOS and Nexus PortChannel Display for MACs_BOTH-Versions.JPG
MAC Track SQL Query Difference Between Cat IOS and Nexus PortChannel Display for MACs_BOTH-Versions.JPG (116.21 KiB) Viewed 3465 times

User avatar
jrush
Posts: 8
Joined: Tue May 30, 2017 3:50 am

Re: [patch] Track devices on Cisco etherchannel interfaces

#7 Post by jrush » Fri Jun 02, 2017 1:38 am

monitoringisfuncr, let's try to change in mactrack_cisco.php this:

Code: Select all

(preg_match("/^Po\d/", $ifName)
to this:

Code: Select all

(preg_match("/^Po\d/", $ifName)||(preg_match("/^port-channel\d/", $ifName)

User avatar
JorisFRST
Cacti User
Posts: 211
Joined: Mon Oct 02, 2006 1:22 pm
Location: Belgium
Contact:

Re: [patch] Track devices on Cisco etherchannel interfaces

#8 Post by JorisFRST » Tue Feb 06, 2018 10:47 am

Hi,

did this ever get implemented in the last version of mactrack ? (or the develop version in github ?)

Thanks,

Joris.
Joris.
http://www.routerjanitor.com

netniV
Cacti Guru User
Posts: 2666
Joined: Sun Aug 27, 2017 12:05 am

Re: [patch] Track devices on Cisco etherchannel interfaces

#9 Post by netniV » Fri Feb 09, 2018 5:01 am

If you are talking about the endpoint patch above, simple answer is no. I can't see it in there.

User avatar
Pucho
Cacti User
Posts: 180
Joined: Wed Jul 20, 2016 8:00 pm

Re: [patch] Track devices on Cisco etherchannel interfaces

#10 Post by Pucho » Sun Feb 18, 2018 3:31 pm

I'd be nice to have it but I think it may need rework.

You don't want to end up with lots of duplicated data for the port-channel interface + its members. I'll check if we can get etherchannel members from snmp to be able to exclude data from them.
Having said that, I haven't looked at the patch =P

@netniV, if you want to have a crack at that, I'm happy to help you out with the snmpwalks and testing. I rather let you do all the php stuff, I'm a php monkey hehe
Cacti - 1.1.37
Poller Type - Spine
Weathermap 0.98a
Server Info - Linux 3.10.0 - Centos 7
Web Server - Apache/2.4.6 PHP 5.4.16
MySQL - 5.5 ;RRDTool - 1.4.8 ;SNMP - 5.7.2
Religion - Anti forum pets

Code: Select all

SYSTEM STATS: Time:17.7383 Method:spine Processes:1 Threads:10 Hosts:279 HostsPerProcess:279 DataSources:7309 RRDsProcessed:3718

Code: Select all

WEATHERMAP STATS: Weathermap 0.98 run complete - Thu, 16 Nov 17 08:42:56 +1300: 39 maps were run in 23.22 seconds with 0 warnings.

netniV
Cacti Guru User
Posts: 2666
Joined: Sun Aug 27, 2017 12:05 am

Re: [patch] Track devices on Cisco etherchannel interfaces

#11 Post by netniV » Thu Feb 22, 2018 5:40 pm

Maybe. I think open it as a request on the github repo and we can take a peek next week.


Post Reply