[patch] Track devices on Cisco etherchannel interfaces

Support questions about the MAC Track plugin

Moderators: Developers, Moderators

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

[patch] Track devices on Cisco etherchannel interfaces

Post by matej_v »

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 401 times
User avatar
TheWitness
Developer
Posts: 16897
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

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 dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
matej_v
Posts: 29
Joined: Thu Feb 12, 2009 3:02 pm
Location: Slovenia

Post by matej_v »

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 553 times
toe_cutter
Cacti User
Posts: 168
Joined: Fri Sep 12, 2008 2:41 am
Location: Sweden

Post by toe_cutter »

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

Post by monitoringisfuncr »

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

Post by monitoringisfuncr »

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 11926 times
User avatar
jrush
Posts: 8
Joined: Tue May 30, 2017 3:50 am

Re: [patch] Track devices on Cisco etherchannel interfaces

Post by jrush »

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: 229
Joined: Mon Oct 02, 2006 1:22 pm
Location: Belgium
Contact:

Re: [patch] Track devices on Cisco etherchannel interfaces

Post by JorisFRST »

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: 3440
Joined: Sun Aug 27, 2017 12:05 am

Re: [patch] Track devices on Cisco etherchannel interfaces

Post by netniV »

If you are talking about the endpoint patch above, simple answer is no. I can't see it in there.
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
User avatar
Pucho
Cacti User
Posts: 185
Joined: Wed Jul 20, 2016 8:00 pm

Re: [patch] Track devices on Cisco etherchannel interfaces

Post by Pucho »

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.2.15
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
netniV
Cacti Guru User
Posts: 3440
Joined: Sun Aug 27, 2017 12:05 am

Re: [patch] Track devices on Cisco etherchannel interfaces

Post by netniV »

Maybe. I think open it as a request on the github repo and we can take a peek next week.
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
netniV
Cacti Guru User
Posts: 3440
Joined: Sun Aug 27, 2017 12:05 am

Re: [patch] Track devices on Cisco etherchannel interfaces

Post by netniV »

Did you open an issue for this? I can't recall.
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests