[FC] MAC Track MOD: VLAN Filter
Moderators: Developers, Moderators
[FC] MAC Track MOD: VLAN Filter
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),
And when I choose a VLAN the table updates and filter's the display (as shown below),
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.
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),
And when I choose a VLAN the table updates and filter's the display (as shown below),
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 563 times
-
- Cacti User
- Posts: 59
- Joined: Tue Dec 19, 2006 4:35 pm
Appreciated
Little "mods" like these are always useful Thanks!
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
This is Done!! in SVN.
TheWitness
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?
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?
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
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
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?
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?
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
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?
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?
Re: [FC] MAC Track MOD: VLAN Filter
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.
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.
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.
Who is online
Users browsing this forum: No registered users and 0 guests