Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISP detection should support the DB-IP ASN database #16499

Closed
d0m84 opened this issue Sep 30, 2020 · 5 comments · Fixed by #16503
Closed

ISP detection should support the DB-IP ASN database #16499

d0m84 opened this issue Sep 30, 2020 · 5 comments · Fixed by #16503
Assignees
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Milestone

Comments

@d0m84
Copy link

d0m84 commented Sep 30, 2020

The current recommendation for users is to use the DB-IP City database, since it offers automatic download and no account creation.

After you did that, the location detection works but the ISP detection doesn't work.
But DB-IP offers an ASN database for this use case as well.

I'm not into the details of .mmdb (or PHP) but it also seems to hold the same keys.

This is the ASN Lite database from Maxmind which works with Matomo

# mmdblookup -f GeoLite2-ASN.mmdb -i 140.82.121.3
  {
    "autonomous_system_number":
      36459 <uint32>
    "autonomous_system_organization":
      "GITHUB" <utf8_string>
  }

This is the free ASN database from DB-IP which doesn't work with Matomo (https://db-ip.com/db/download/ip-to-asn-lite)

# mmdblookup -f GeoLite2-ASN.mmdb -i 140.82.121.3
  {
    "autonomous_system_number":
      36459 <uint32>
    "autonomous_system_organization":
      "GitHub, Inc." <utf8_string>
  }

So for me it looks like the data is there, but the detection just doesn't work with this database. Once this is done the documentation and the updater script could be much easier as well.

@tsteur
Copy link
Member

tsteur commented Oct 1, 2020

@d0m84 thanks for creating the issue. Do I understand correctly that you are using our Provider plugin and ISP detection doesn't work when using the free ASN DB from DB-IP but it does work with the free ASN DB from MaxMind?

@d0m84
Copy link
Author

d0m84 commented Oct 1, 2020

@tsteur

Exactly.
I tested it with two different versions of those databases and named them always GeoLite2-ASN.mmdb and placed it in the misc/ folder. With Maxmind Org and ISP detection works, with DB-IP it doesn't.

I'm using the maxminddb PHP extension as suggested.

@sgiehl
Copy link
Member

sgiehl commented Oct 1, 2020

I will have a quick look. Maybe the database has a type Matomo can't handle yet...

@sgiehl sgiehl self-assigned this Oct 1, 2020
@sgiehl
Copy link
Member

sgiehl commented Oct 1, 2020

@d0m84 as expected, their database has a type, that isn't handled by Matomo yet. I'll create a PR to add that in Matomo 4.

@d0m84
Copy link
Author

d0m84 commented Oct 1, 2020

@sgiehl

Wow that was super fast, thank you very much!

@tsteur tsteur added the Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. label Oct 1, 2020
@tsteur tsteur added this to the 4.0.0-RC milestone Oct 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants