Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Wed Jun 28, 2017 7:37 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: [patch] Track devices on Cisco etherchannel interfaces
PostPosted: Wed Mar 31, 2010 2:36 pm 
Offline

Joined: Thu Feb 12, 2009 3:02 pm
Posts: 29
Location: Slovenia
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:
File comment: Track devices on Port-channel ifaces. Apply against SVN rev 834
mactrack_cisco_etherchannel.patch [2.65 KiB]
Downloaded 118 times
Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 31, 2010 4:40 pm 
Offline
Developer
User avatar

Joined: Tue May 14, 2002 5:08 pm
Posts: 14863
Location: MI, USA
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
Gandalfs Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 01, 2010 6:04 am 
Offline

Joined: Thu Feb 12, 2009 3:02 pm
Posts: 29
Location: Slovenia
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:
File comment: Alternative end port detection. Apply mactrack_cisco_etherchannel.patch first.
mactrack_alt_end_port_detection.patch [5.18 KiB]
Downloaded 293 times
Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 01, 2010 6:41 am 
Offline
Cacti User

Joined: Fri Sep 12, 2008 2:41 am
Posts: 168
Location: Sweden
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.


Top
 Profile  
 
 Post subject: Re: [patch] Track devices on Cisco etherchannel interfaces
PostPosted: Thu Jun 01, 2017 2:57 pm 
Offline

Joined: Wed Dec 07, 2016 11:25 am
Posts: 11
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 ?


Top
 Profile  
 
 Post subject: Re: [patch] Track devices on Cisco etherchannel interfaces
PostPosted: Thu Jun 01, 2017 3:52 pm 
Offline

Joined: Wed Dec 07, 2016 11:25 am
Posts: 11
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 1795 times ]
Top
 Profile  
 
 Post subject: Re: [patch] Track devices on Cisco etherchannel interfaces
PostPosted: Fri Jun 02, 2017 1:38 am 
Offline
User avatar

Joined: Tue May 30, 2017 3:50 am
Posts: 8
monitoringisfuncr, let's try to change in mactrack_cisco.php this:
Code:
(preg_match("/^Po\d/", $ifName)

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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group