Show host name and not 'provider'

We’re using piwik to track internal usage of web services by parsing the apache access.log files with the Log Analytics.

Unfortunately in the IP / Provider tab I would only get the IP address and not the host name of the server. I did enable the --enable-reverse-dns flag but what I was receiving was the root hostname for our network… “myco.com” as the provider which is not very helpful, as I need to know the name of the machine that is calling the service.

I made a couple of changes in the Provider plugin for 1.12

In functions.php Piwik_getHostnameUrl I removed the final if block that checks to see if the provider looks like a URL

In provider.php I changed line 175 to return the host name with out cleaning it.

$hostnameExtension = $this->getHost($ip);
$hostnameExtension = $this->getCleanHostname($hostname);

Hopefully we could get a configuration flag for this in an upcoming version. There is a small bug that where the host name isn’t found the IP address looks like “10.” but this is good enough for me