#877 Browser and os detection

7.0
open
nobody
5
2014-09-11
2011-10-30
Andreas Tunberg
No

Browser and os detection are not working after update from 6.95 to 7.0.
I added the fowling code to awststs.pl to solve my problems.
%OSFamily = (
'win' => 'Windows',
'mac' => 'Macintosh',
'linux' => 'Linux',
'bsd' => 'BSD'
);
%BrowsersFamily = (
'msie' => 1,
'firefox' => 2,
'netscape' => 3,
'svn' => 4,
'opera' => 5,
'safari' => 6,
'chrome' => 7,
'konqueror' => 8
);

Discussion

  • Where did you added this code?

     
  • In awstats.pl at row 393 under "%MiscListCalc" i added:

    %BrowsersFamily = (
    'msie' => 1,
    'firefox' => 2,
    'netscape' => 3,
    'svn' => 4,
    'opera' => 5,
    'safari' => 6,
    'chrome' => 7,
    'konqueror' => 8
    );

    PS. The "%OSFamily" works and I haven't added that.

     
  • Andrew Denman
    Andrew Denman
    2011-12-09

    Are you using the 'allphones' browser detection level?

    It looks like the %BrowsersFamily code was moved out of the main file and not copied to the wwwroot\cgi-bin\lib\browsers_phone.pm file.

     
  • Ok, I am using 'allphones'.

     
  • eracc
    eracc
    2012-06-17

    I just installed awstats 7.0 locally using the package from our Linux distribution (Mageia 2) to process records for several subdomains on our web host. The browser detection works, the OS detection does not. It appears that the OS list is in the file /usr/share/awstats/lib/operating_systems.pm but the report always shows an empty Browsers list. I do not want to fudge up our awstats.pl with "%OSFamily = " as shown in this bug report. That would cause problems when our distribution provides an upgrade to awstats when that is available.

    What is the proper way to fix this please?

     
  • To fix this add the missing "%OSFamily" lines in \lib\browsers_phone.pm.
    This fault only appears using the 'allphones' browser detection level?

     
  • eracc
    eracc
    2012-06-17

    ...
    LevelForBrowsersDetection=2
    LevelForOSDetection=2
    ...

    That is what is in our awstats.conf file here. As I understand it, one has to replace "LevelForBrowsersDetection=2" with "LevelForBrowsersDetection=allphones" to use the 'allphones' browser detection level. I do not see how the browser line would affect the operating system detection. When I view /usr/share/awstats/lib/operating_systems.pm it does have this section included:

    Relocated from main file for easier editing

    %OSFamily = (
    'win' => 'Windows',
    'mac' => 'Macintosh',
    'linux' => 'Linux',
    'bsd' => 'BSD'
    );

    What else can I do? Thanks.

     
  • Joe
    Joe
    2012-10-25

    It would be great if anyone could help resolve the issue I'm facing.

    I've recently installed awstats7.0, but somehow the Operating Systems, Robots/Spiders are not detected.Following is the config of my apache & awstats

    APACHE
    LogFormat "\"%{X-Forwarded-For}i\" %h %l %u %t \"%r\" %>s %b %D \"%{Referer}i\" \"%{User-agent}i\""

    Following are the entries in apache log (normal request, pingdom check)

    "122.16.41.99" 192.168.1.191 - - [25/Oct/2012:13:55:40 +0000] "GET /individual/images/header-pattern-bg-img.gif HTTP/1.1" 200 2136 927528 "https://www.testing.com/individual/css/common_new.css" "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:16.0) Gecko/20100101 Firefox/16.0"

    "69.59.28.19" 192.168.1.191 - - [25/Oct/2012:00:20:38 +0000] "GET /individual/healthcheck.jsp HTTP/1.0" 200 11 672 "-" "Pingdom.com_bot_version_1.4_(http://www.pingdom.com)"

    AWSTATS
    LogFormat="%h %other %l %u %t \"%r\" %>s %b %D \"%{Referer}i\" \"%{User-Agent}i\""

    Have already tried adding "%OSFamily" section in awstats.pl, but still it's not working.

     
  • Problem with "LevelForBrowsersDetection=allphones" where %BrowsersFamily code was missing in browsers_phone.pm are now fixed in 7.1 beta.