All stuffs i've changed in mactrack\lib\mactrack_functions.

Support questions about the MAC Track plugin

Moderators: Developers, Moderators

Post Reply
inoujk
Posts: 6
Joined: Wed Sep 18, 2013 10:24 am

All stuffs i've changed in mactrack\lib\mactrack_functions.

Post by inoujk »

just for information (it can help someone), here are all the stuff i've changed in file :
mactrack\lib\mactrack_functions.php

variable "$store_to_db = TRUE;" don't manage to setup, so i add it under the function name :

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;

	$store_to_db = TRUE;       <---------- ADD

	/* initialize variables */

for authorization error "DEBUG: MAC Address 'xx:xx:xx:xx:xx:xx' on device 'xxxxxx' is NOT Authorized" , anything i add in "mac authorization" to allow every mac adress don't work, so i add :

Code: Select all

/* db_check_auth - This function checks whether the mac address exists in the mac_track+macauth table
*/
function db_check_auth($mac_address) {
	$check_string = "SELECT mac_id FROM mac_track_macauth WHERE mac_address LIKE '%%" . $mac_address . "%%'";
//	mactrack_debug("SQL: " . $check_string);

	$query = db_fetch_cell($check_string);
	$query = $mac_address;                                   <------------------- ADD

	return $query;
}
IP table don't fill up :

Code: Select all

if ($store_to_db) {
	if ($ports_active <= 0) {
		$device["last_runmessage"] = "Data collection completed ok";
		}elseif (sizeof($new_port_key_array)) {
			$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);
			get_standard_arp_table($site, &$device);                                                       <-------------------- ADD
		}else{
			$device["last_runmessage"] = "WARNING: Poller did not find active ports on this device.";
		}

In Interfaces tab, Alias don't fill up :

Code: Select all

*/
function build_InterfacesTable(&$device, &$ifIndexes, $getLinkPorts = TRUE, $getAlias = TRUE) {  
	global $cnn_id;
	$getLinkPorts = TRUE; $getAlias = TRUE;          <-----------ADD

	/* initialize the interfaces array */

Port name and number are incorect in "MAC Addresses" tab :

Code: Select all

	if (($brPortIfType >= 6) &&
		($brPortIfType <= 9) &&
		(!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"];

		// Modif nom port
		$new_port_key_array[$i]["port_number"] = $ifInterfaces[$brPortIfIndex]["ifName"];           <--------- ADD
		$new_port_key_array[$i]["port_name"]   = $ifInterfaces[$brPortIfIndex]["ifAlias"];            <---------- ADD
		
		$i++;
	}
not cute code but it work..

For missing tab in cacti, see this post :
http://forums.cacti.net/viewtopic.php?f=15&t=41230


hope all this help someone..
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests