[TOC]
https://github.com/Cacti/plugin_mactrack/commit/cc681b143cfdd43ec79a800009699308d5832407
The bug occurred when using Juniper EX2200 Switches.
$Xvlanid = substr($num, 0, strpos($num, '.'));
was changed to
$Xvlanid = substr($num, strpos($num, '.')+1, strpos($num, '.',1)-1);
and
$ifIndex = @$port_results[$mac_result];
was changed to
$ifIndex = @$port_results[".".strval($mac_result)];
in the lib\mactrack_juniper.php
file.
An extra dot was added to the keys of the port dictionary when it was made from the OID.
https://github.com/Cacti/plugin_mactrack/commit/f2deee43c1229e5bd3110e19e685153b57bfc76c
Changes are available on the link above.
Basically the start position of the substring was wrong.
When using Juniper switches the trunk counter was not implemented.
/* get VLAN Trunk status */
$vlan_trunkstatus = xform_standard_indexed_data('.1.3.6.1.4.1.2636.3.40.1.5.1.7.1.5', $device);
foreach ($vlan_trunkstatus as $vts) {
if ($vts == 2) {
$device['ports_trunk']++;
}
}
was added to the code.
Changed Juniper port names, port numbers and port descriptions according to Cisco's equivalent of the same fields in the DB. Port number became Interface name (e.g. ge-0/0/0.0). Port name became Interface description. Port description was added to $ifInterfaces. Tested with EX-2200 switches.
https://github.com/Cacti/plugin_mactrack/commit/bc5ba709134006488a80b4cf3beae782fd9fbd84
https://github.com/Cacti/plugin_mactrack/commits/develop (it was not accepted by the official Cacti repository when the documentation was made.)
Port ignore option was not implemented for Juniper switches.
Main debugging tool:
-d stands for debug mode.
-id=deviceid selects the device on which the scan will run
The result of the scan will be saved to the mac_track_temp_ports table in mysql. It won't be merged into the mac_track_ports table which is used by Cacti to build the view macs webpage.
php mactrack_scanner.php -d -id=10
It runs the SNMP poller on all devices
php poller_mactrack.php -d -f
-d stands for debug mode
-f means force (~ run now, don't wait for the next scheduled scan.)
If the poller or the scanner was terminated you should clear the mac_track_processes table by hand.
To clear the mac addresses from Cacti you should TRUNCATE the mac_track_ports table.
When editing a device from Cacti you should check mac_track_devices table. Sometimes it makes a duplicate entry. Simply delete the old one.
Copyright (c) 2004-2024 - The Cacti Group, Inc.