oui database update via proxy [solved]

Support questions about the MAC Track plugin

Moderators: Developers, Moderators

Post Reply
mf2hd
Posts: 4
Joined: Wed May 21, 2014 8:00 am

oui database update via proxy [solved]

Post by mf2hd »

Hallo,

our cacti installation has internet access only via http proxy, so the oui database refresh doesn´t work.

I patched mactrack_functions.php and hardcoded the proxy. Replace the following line in function import_oui_database:

Code: Select all

	$oui_database = file($oui_file);
with

Code: Select all

/* ######################################################## */
/*  proxy hack
/* -------------------------------------------------------- */


	$rd_proxy = "tcp://10.10.10.1:3128";

	$rd_proxy_context = "";
	$rd_proxy_context = stream_context_create(Array(
		"http" => Array(
		
			"proxy" => $rd_proxy,
			"request_fulluri" => true)
		)
	); 


	$oui_database = file($oui_file,false,$rd_proxy_context);


	if ($type != "ui") print "<tr><td>";

	echo "Proxy for OUI Database Download $rd_proxy\n";

/* ######################################################## */
In the example above the proxy-host is 10.10.10.1 with proxy-port 3128. Our proxy doesn´t require authentication.

I am not a PHP programmer, so somebody should do this right (configurable, authentication ?). This hack works with Mactrack 2.9, PHP 5.2.12 and Cacti 0.8.8b.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests