[FC] MAC Track MOD: VLAN Filter

Support questions about the MAC Track plugin

Moderators: Developers, Moderators

Post Reply
warnesj
Cacti User
Posts: 173
Joined: Sun May 29, 2005 7:34 pm

[FC] MAC Track MOD: VLAN Filter

Post by warnesj »

Hi all, love this plugin TheWitness! I made a little mod to it though that I thought I'd share.

With some of my switches (okay, probably all of my switches) I run multiple VLANs on them. Sometime I want information on just a particular VLAN for a site or a switch. MAC Track has all that information so I took a stab a modifying the code to help me filter for a VLAN and display information about it in the viewer table.

I made some changes to mactrack_view.php and html/inc_mactrack_view_site_filter_table.php and I think I have it working now. I've included both of the modified files below in the attached .zip file. In the mactrack_view.php I've tagged most of the changes with "//VLAN changes start" and "//VLAN changes end" so you can see where I made changes (or just look for every instance of "m_vlan_id" which is the session variable I use). I marked the changes in html/inc_mactrack_view_site_filter_table.php with some HTML comments (just look for "VLAN" and it'll take you to the area I added stuff).

Now my display has a VLAN filter drop-down list in it (highlighted in the image below),
Image

And when I choose a VLAN the table updates and filter's the display (as shown below),
Image

One thing that I think I'm going to do is alter the mac_track_ports table to index both the vlan_id and vlan_name rows to help speed up the creation of the drop-down list. But I really HATE modifying database tables just in case the changes I make screw up future usability.

Not sure if anyone else will find this mod useful, but I thought I'd share it anyway.
Attachments
mactrack_vlan_filter_mod.zip
MAC Track VLAN Filter MOD files
(9.39 KiB) Downloaded 507 times
MagicOneXXX
Cacti User
Posts: 59
Joined: Tue Dec 19, 2006 4:35 pm

Appreciated

Post by MagicOneXXX »

Little "mods" like these are always useful :-) Thanks!
User avatar
TheWitness
Developer
Posts: 16897
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

This is Done!! in SVN.

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?
bambid
Posts: 23
Joined: Thu Nov 02, 2006 3:10 am

Post by bambid »

Hi Witness, when will be available new version of MAC Track ?
David
User avatar
TheWitness
Developer
Posts: 16897
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

I have 3 major features to write and am taking Device Type exports from users who have extended the interface. However, I am keeping the SVN fully operational for new features.

You can take snapshots. I have and will not touch scanning functions at this point, I am only adding UI feature and new functionality to go along with the existing data, so you should be safe.

However, you MUST be at Cacti 0.8.6i in order to take the SVN version.

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?
warnesj
Cacti User
Posts: 173
Joined: Sun May 29, 2005 7:34 pm

Post by warnesj »

TheWitness wrote:This is Done!! in SVN.

TheWitness
Was this in SVN before my post, if so sorry about that. I don't typically look at the SVN versions. I suppose I should.
User avatar
TheWitness
Developer
Posts: 16897
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Yes.
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?
User avatar
Vins
Cacti User
Posts: 116
Joined: Tue Sep 12, 2006 3:06 am

Re: [FC] MAC Track MOD: VLAN Filter

Post by Vins »

But still is not available in the stable version of branch 0.8.7x/0.8.8x... :( maybe I'm wrong, but I haven't seen it. :roll:
I've noticed the presence of the mac_track_vlan table and digged into the Cacti forum, finding out this post... funny enough, I hade to write a script by myself in order to retrieve all the vlans from the switchs; I've never wasted that time if I knew that mactrack already had this hidden functionality... :-?

I'm quite sure most of the mactrack users would find it very useful. :wink:
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest