Place Your Feature Requests & Bug Reports Here

Support questions about the MAC Track plugin

Moderators: Developers, Moderators

Post Reply
peecee
Cacti User
Posts: 146
Joined: Tue Feb 26, 2008 7:26 am

MAC Track Color Tab bug

Post by peecee »

When I select the mactrack tab, the color of the tab is not updated to red - it stays blue. I have the following installed:

Cacti 0.8.7b
PIA 2.0
Settings plugin
Thold plugin

Also, should the menu bar on the left side of the screen disappear when the mactrack tab is selected? It seems like it should stay there.
niobe
Cacti User
Posts: 228
Joined: Mon Mar 10, 2008 6:52 pm
Location: Australia

Post by niobe »

Corrupt documentation in 1.1...please repackage

Also does not appear to work correctly with PA2.0 as sql is not automatically imported.
iancw
Posts: 4
Joined: Tue Apr 15, 2008 3:20 am

Post by iancw »

Anybody get mactrack working for Cisco 3500XL switches? Could you please tell me how to get this working, it's not discovering the interfaces properly.
prof
Posts: 7
Joined: Fri Jul 11, 2008 6:08 am

Post by prof »

A feature request.

Some of my switches only show a number for the portname. Please could you add a custom column where we could insert a custom name for that port on the switch? A seperate table with a primary key (switch id + port number) and Name as a string, that would be great or implement it into a already existing table such mactrack_interfaces?

I think i could implement it, but you understand your addon better than me.

The second feature request is as follows. We have some DL380 which are connected to a Procurve 2824. On that DL380 i have configured a HP Network team. This is schown in SNMP not with ethernetCsmacd(6) but with ieee8023adLag(161). I have patched mactrack_functions and my scanning function that i use. Now these Ports are displayed. So User Ports are not between 6 and 9 there is also a 161.
In function get_base_dot1dTpFdbEntry_ports

Code: Select all

function get_base_dot1dTpFdbEntry_ports($site, &$device, &$ifInterfaces, $snmp_readstring = "", $store_to_db = TRUE, $lowPort = 1, $highPort = 9999) {
        global $debug, $scan_date;

        /* initialize variables */
        $port_keys = array();
        $return_array = array();
        $new_port_key_array = array();
        $port_key_array = array();
        $port_number = 0;
        $ports_active = 0;
        $active_ports = 0;
        $ports_total = 0;

        /* cisco uses a hybrid read string, if one is not defined, use the default */
        if ($snmp_readstring == "") {
                $snmp_readstring = $device["snmp_readstring"];
        }

        /* get the operational status of the ports */
        $active_ports_array = xform_standard_indexed_data(".1.3.6.1.2.1.2.2.1.8", $device);
        $indexes = array_keys($active_ports_array);

        $i = 0;
        foreach($active_ports_array as $port_info) {
                if ((($ifInterfaces[$indexes[$i]]["ifType"] >= 6) &&
                        ($ifInterfaces[$indexes[$i]]["ifType"] <= 9)) ||
                        ($ifInterfaces[$indexes[$i]]["ifType"] == 161)) {
                        mactrack_debug("INFOME: ".$port_info." - ".$ifInterfaces[$indexes[$i]]["ifType"]);
                        if ($port_info == 1) {
                                $ports_active++;
                        }
                        $ports_total++;
                }
                $i++;
        }
        if ($store_to_db) {
                print("INFO: HOST: " . $device["hostname"] . ", TYPE: " . substr($device["snmp_sysDescr"],0,40) . ", TOTAL PORTS: " . $ports_total . ", OPER PORTS: " . $ports_active);
                if ($debug) {
                        print("\n");
                }

                $device["ports_active"] = $ports_active;
                $device["ports_total"] = $ports_total;
                $device["macs_active"] = 0;
        }

        if ($ports_active > 0) {
                /* get bridge port to ifIndex mapping */
                $bridgePortIfIndexes = xform_standard_indexed_data(".1.3.6.1.2.1.17.1.4.1.2", $device, $snmp_readstring);

                $port_status = xform_stripped_oid(".1.3.6.1.2.1.17.4.3.1.3", $device, $snmp_readstring);

                /* get device active port numbers */
                $port_numbers = xform_stripped_oid(".1.3.6.1.2.1.17.4.3.1.2", $device, $snmp_readstring);

                /* get the ignore ports list from device */
                $ignore_ports = port_list_to_array($device["ignorePorts"]);

                /* determine user ports for this device and transfer user ports to
                   a new array.
                */
                $i = 0;
                foreach ($port_numbers as $key => $port_number) {
                        if (($highPort == 0) ||
                                (($port_number >= $lowPort) &&
                                ($port_number <= $highPort))) {

                                if (!in_array($port_number, $ignore_ports)) {
                                        if (@$port_status[$key] == "3") {
                                                $port_key_array[$i]["key"] = $key;
                                                $port_key_array[$i]["port_number"] = $port_number;

                                                $i++;
                                        }
                                }
                        }
                }

                /* compare the user ports to the brige port data, store additional
                   relevant data about the port.
                */
               $i = 0;
                foreach ($port_key_array as $port_key) {
                        /* map bridge port to interface port and check type */
                        if ($port_key["port_number"] > 0) {
                                if (sizeof($bridgePortIfIndexes) != 0) {
                                        /* some hubs do not always return a port number in the bridge table.
                                           test for it by isset and substiture the port number from the ifTable
                                           if it isnt in the bridge table
                                        */
                                        if (isset($bridgePortIfIndexes[$port_key["port_number"]])) {
                                                $brPortIfIndex = @$bridgePortIfIndexes[$port_key["port_number"]];
                                        }else{
                                                $brPortIfIndex = @$port_key["port_number"];
                                        }
                                        $brPortIfType = @$ifInterfaces[$brPortIfIndex]["ifType"];
                                }else{
                                        $brPortIfIndex = $port_key["port_number"];
                                        $brPortIfType = @$ifInterfaces[$port_key["port_number"]]["ifType"];
                                }

                                if (   ( (($brPortIfType >= 6) &&
                                         ($brPortIfType <= 9)) ||
                                         ($brPortIfType == 161)
                                        ) &&
                                        (!isset($ifInterfaces[$brPortIfIndex]["portLink"]))) {
                                        /* set some defaults  */
                                        $new_port_key_array[$i]["vlan_id"] = "N/A";
                                        $new_port_key_array[$i]["vlan_name"] = "N/A";
                                        $new_port_key_array[$i]["mac_address"] = "NOT USER";
                                        $new_port_key_array[$i]["port_number"] = "NOT USER";
                                        $new_port_key_array[$i]["port_name"] = "N/A";

                                        /* now set the real data */
                                        $new_port_key_array[$i]["key"] = $port_key["key"];
                                        $new_port_key_array[$i]["port_number"] = $port_key["port_number"];
                                        $i++;
                                }
                        }
                }
                mactrack_debug("Port number information collected.");
                /* map mac address */
                /* only continue if there were user ports defined */
                if (sizeof($new_port_key_array) > 0) {
                        /* get the bridges active MAC addresses */
                        $port_macs = xform_stripped_oid(".1.3.6.1.2.1.17.4.3.1.1", $device, $snmp_readstring);

                        foreach ($port_macs as $key => $port_mac) {
                                $port_macs[$key] = xform_mac_address($port_mac);
                        }

                        foreach ($new_port_key_array as $key => $port_key) {
                                $new_port_key_array[$key]["mac_address"] = @$port_macs[$port_key["key"]];
                                mactrack_debug("INDEX: '". $key . "' MAC ADDRESS: " . $new_port_key_array[$key]["mac_address"]);
                        }

                        mactrack_debug("Port mac address information collected.");
                }else{
                        mactrack_debug("No user ports on this network.");
                }
        }else{
                mactrack_debug("No user ports on this network.");
        }

        if ($store_to_db) {
                if ($ports_active <= 0) {
                        $device["last_runmessage"] = "Data collection completed ok";
                }elseif (sizeof($new_port_key_array) > 0) {
                        $device["last_runmessage"] = "Data collection completed ok";
                        $device["macs_active"] = sizeof($new_port_key_array);
                        db_store_device_port_results($device, $new_port_key_array, $scan_date);
                }else{
                        $device["last_runmessage"] = "WARNING: Poller did not find active ports on this device.";
                }

                if(!$debug) {
                        print(" - Complete\n");
                }
        }else{
                return $new_port_key_array;
        }
}
User avatar
streaker69
Cacti Pro User
Posts: 712
Joined: Mon Mar 27, 2006 10:35 am
Location: Psychic Amish Network Administrator

Post by streaker69 »

One little quick fix so that you can properly sort by Port Number.

Change port_number in the mac_track_ports table from vchar to int.
Attachments
SP32-20080813-144653.gif
SP32-20080813-144653.gif (3.65 KiB) Viewed 8497 times
[b]Cacti Version[/b] - 0.8.7d
[b]Plugin Architecture[/b] - 2.4
[b]Poller Type[/b] - Cactid v
[b]Server Info[/b] - Linux 2.6.18-128.1.6.el5
[b]Web Server[/b] - Apache/2.2.3 (CentOS)
[b]PHP[/b] - 5.2.9
[b]MySQL[/b] - 5.0.45-log
[b]RRDTool[/b] - 1.3.0
[b]SNMP[/b] - 5.3.2.2
[b]Plugins[/b]PHP Network Managing v0.6.1, Global Plugin Settings v0.6,thold v0.4.1,XMLPort v0.3.5,CactiCam v0.1.5,NetTools v0.1.5,pollperf v0.32,RRD Cleaner v1.1,sqlqueries v0.2,superlinks v0.8,syslog v0.5.2,update v0.4,discovery v0.9,zond v0.34a,hostinfo v0.2,Bloom v0.6.5,mactrack v1.1,weathermap v0.96a,mobile v0.1
scubabri
Posts: 32
Joined: Thu Jul 13, 2006 3:11 pm

authorize/revoke broken

Post by scubabri »

The authorize only works on the current pull, any subsequent one's are all flagged as not authorized. Makes it very difficult to detect changes on the network.

Is anyone else having this problem? Is anyone else using this and is it working?

I'm very excited about this plugin, but with the authorize/revoke not working it pretty seriously limits anotherwise fantasic plugin.
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

If anyone want's an update to this plugin, I am going to need people to sign up for Beta testing and also need a few developers to step forward. I am no longer in the network space in my current work. So, my compulsion to keep this thing going is somewhat near 0.

With that said however, I hope everyone enjoys what I actually was able to deliver.

If there are any folks interesting in contributing, send me an e-mail and I will coordinate a meeting via a conference call.

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?
nduda78
Cacti User
Posts: 111
Joined: Tue Mar 01, 2005 11:26 am

Switchport config?

Post by nduda78 »

It would be nice to click on the switchport (i.e. Gi4/24) and get the actual config details on that port. Maybe this exists in another addon, im writing this as I was just asked if it was possible.
disH
Posts: 33
Joined: Thu May 22, 2008 2:09 am

Post by disH »

Jupiter Netscreen support!

Our firewall keeps a nice mac/ip table and this makes it easy to track bad users down.

Not sure if it was planned but it works (shows the info) from my CatOS switches which is fantastic.

Since our switches dont store IP info i cannot track users per ip.




*Edit
found some old info Mactrack & Juniper Netscreens? which works. Grabs all the ips and populates it into the database but i cannot get it to reflect in Mactrack.
I do get 2 errors:
Notice: Undefined index: 0.10.10.11.75 in /usr/share/cacti/site/plugins/mactrack/lib/mactrack_functions.php on line 1707

Notice: Undefined index: 0.10.10.11.75 in /usr/share/cacti/site/plugins/mactrack/lib/mactrack_functions.php on line 1708
I'd like to populate this next to my already existing mac addresses in the database + the device itself with associated zone interface.

Output info is something like...

Code: Select all

ipaddr macaddress  VirtualRouter/interface/subinterface[:subport]
192.168.10.23  000f1f7f7879  trust-vr/eth0/1.11:2
10.10.10.145  000c86463808  untrust-vr/eth0/0
At the end of the poller_mactrack.php/mactrack_scanner.php add a function to match the ip addr into the "End Device IP Address**" of already existing records pulled from the Switch devices.

Then if you search in MAC to IP Report View per ip, you will get double records from firewall & switch

Something like that would be awesome, i can provide SNMP outputs to make it work.
[url=http://forums.cacti.net/viewtopic.php?t=4356]Template: Cisco CatOS[/url]
[url=http://forums.cacti.net/viewtopic.php?t=21785]Mactrack: Netscreen Fw[/url]
[b]_______________[/b]
[b]Cacti Version[/b] - 0.8.7e, [b]Plugin Architecture[/b] - 2.5, [b]Poller Type[/b] - Cact-Spine 0.8.7e
[b]Server Info[/b] - Ubuntu Server 8.10 (2.6.27-7-server), [b]Web Server[/b] - Apache/2.2.9 PHP/5.2.6-2ubuntu4.3 with Suhosin-Patch
[b]PHP[/b] - 5.2.6-2ubuntu4.3, [b]MySQL[/b] - 5.0.67-0ubuntu6-log, [b]RRDTool[/b] - 1.3.1, [b]SNMP[/b] - 5.4.1
[b]Plugins[/b] - Thresholds v0.4.1, Login Mod v1.0, Host Info v0.2
perjaka
Posts: 9
Joined: Tue Feb 03, 2009 5:32 pm

Support for Force10 S, C and E series gear

Post by perjaka »

I'd like to see support for Force10 gear! S, E and C series.
jafne
Posts: 6
Joined: Thu Aug 17, 2006 7:59 am

Re: Switchport config?

Post by jafne »

nduda78 wrote:It would be nice to click on the switchport (i.e. Gi4/24) and get the actual config details on that port. Maybe this exists in another addon, im writing this as I was just asked if it was possible.
I'd be interested in this, as well.
[quote][b]Cacti Version[/b] - 0.8.8f
[b]Plugin Architecture[/b] - 3.1
[b]Server Info[/b] - CentOS 5.11
[b]Web Server[/b] - Apache/2.2.3 (CentOS)
[b]PHP[/b] - 5.1.6
[b]MySQL[/b] - 5.0.95
[b]RRDTool[/b] - 1.2.23
[b]SNMP[/b] - 5.3.2
[b]Plugins[/b][list]Global Plugin Settings (settings - v0.71)
Thresholds (thold - v0.5)
Device Tracking (mactrack - v2.9)
PHP Network Weathermap (weathermap - v0.97c)
ipsubnet - v0.4f
SuperLinks (superlink - v1.4)
Create Aggregate Graphs (aggregate - v0.75)[/list][/quote]
hipster
Posts: 30
Joined: Thu Mar 16, 2006 7:54 am

What went wrong?

Post by hipster »

Hi,

I upgraded cacti + pa and installed mactrack 2.0 from svn.

Cacti Version: 0.8.7e
Plugin Architecture Version: 2.5
Device Tracking Directory: mactrack Version: 2.0

form some reason GUI is not working as I expected. E.g. under mactrack->Devices there is a list of all devices added. Device names looks like links (bold blue) but do not lead any where if clicked.

here is a snip of source code

Code: Select all


<tr bgcolor='#F5F5F5'>
				<td width=60></td>
				<td width=150>
					<p class='linkEditMain'>device-hostnamel</p>				</td>
				<td>Site1</td>
				<td><span style='color: #198e32'>Up</span></td>
				<td>xxx.xxx.xxx.xxx</td>
				<td>Switch/Router</td>
				<td>9</td>
				<td>102</td>
				<td>13</td>
				<td>0</td>
				<td>0</td>
				<td>0</td>
				<td>228.0</td>
			</tr>
What went wrong?
Attachments
mactrack/images/view_interfaces.gif missing from installation package?
mactrack/images/view_interfaces.gif missing from installation package?
mactrack1.png (17.59 KiB) Viewed 5976 times
Device links not working
Device links not working
mactrack2.png (94.08 KiB) Viewed 5976 times
hipster
Posts: 30
Joined: Thu Mar 16, 2006 7:54 am

Post by hipster »

Also mactrack -> MAC Addresses is empty. I think there should be something as mac addresses are found when scanned.

If I run mactrack from command line mac addresses are found:

Code: Select all

---clip---
INFO: HOST: xxx.xxx.xxx.xxx, TYPE: ProCurve J4900C Switch 2626, revision H., TOTAL PORTS: 26, ACTIVE PORTS: 226DEBUG: SQL: SELECT mac_id FROM mac_track_macauth WHERE mac_address LIKE '%%00:00:0C:07:AC:01%%'
DEBUG: Authorized MAC ID:
DEBUG: SQL: REPLACE INTO mac_track_temp_ports (site_id,device_id,hostname,device_name,vlan_id,vlan_name,mac_address,port_number,port_name,scan_date,authorized) VALUES ('1','4','xxx.xxx.xxx.xxx','device-hostname','1','DEFAULT_VLAN','00:00:0C:07:AC:01','26','TRUNK','2009-09-11 11:38:06','0')
DEBUG: SQL: SELECT mac_id FROM mac_track_macauth WHERE mac_address LIKE '%%00:00:5E:00:01:04%%'
DEBUG: Authorized MAC ID:
---clip---
DEBUG: Authorized MAC ID:
DEBUG: SQL: REPLACE INTO mac_track_temp_ports (site_id,device_id,hostname,device_name,vlan_id,vlan_name,mac_address,port_number,port_name,scan_date,authorized) VALUES ('1','4','xxx.xxx.xxx.xxx','device-hostname','100','VLAN100','00:0C:29:63:09:CA','5','','2009-09-11 11:38:06','0')
DEBUG: SQL: SELECT mac_id FROM mac_track_macauth WHERE mac_address LIKE '%%00:0C:29:7F:78:A4%%'
---clip---
Attachments
macktrack3.png
macktrack3.png (96.32 KiB) Viewed 5969 times
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

I'll put a little work into this over the weekend. Keep your eyes out on SVN. Although, my goals are to work on 0.8.8, I'll allocate some time to getting this into better shape.

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?
hipster
Posts: 30
Joined: Thu Mar 16, 2006 7:54 am

Post by hipster »

Great!

If you manage to fix the GUI I'll put some effort to device scanners.
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests