ratibor78 / geostat

GeoStat, Python script for parsing Nginx and Apache logs files and getting GEO data from incoming IP's.
MIT License
69 stars 20 forks source link

Any log to troubleshoot? #6

Closed charleslcso closed 5 years ago

charleslcso commented 5 years ago

Hello, I've followed the Manual install instruction, and geostat is up and running.

settings.ini, geostat.service are both checked thoroughly.

nginx log sample is below: 192.168.1.72 - - [12/Jul/2019:21:01:40 +0800] "GET /infophp.php HTTP/1.1" 200 23444 "-" "Go-http-client/1.1"

However in InfluxDB, inside the database specified in settings.ini, I still don't see the measurement specified in settings.ini.

We are absolutely sure InfluxDB, nginx are both running properly.

Is there any way to check the status of geostat? Any logs?

The ultimate goal is to show stats in Grafana, using dashboard 8342.

charleslcso commented 5 years ago

After some debugging I found out the cause of my issue.

Basically, i have 2 issues:

I'm an absolute noob in python, and I'm wondering if it is possible to catch error like this:

geoip2.errors.AddressNotFoundError: The address 192.168.1.253 is not in the database.

charleslcso commented 5 years ago

Also after I hardcoded the IP to an external address, Grafana dashboard is working!

ratibor78 commented 5 years ago

Hi @charleslcso , nice to hear that you have found the solution, this script was created for the public IPs as the only public IPs have any GEO data.

Previously there was a patch from @MatStace that fixed the private IP issue and now this script just ignores the 192.168.x.x addresses.

This is the pull request that I mean: https://github.com/ratibor78/geostat/pull/3

But anyway I will update the documentation with additional information about public IP.

Thanks for your activity and feedback!