diff --git a/fail2ban-report b/fail2ban-report index 33fc894..ad0c848 100755 --- a/fail2ban-report +++ b/fail2ban-report @@ -40,8 +40,11 @@ def get_nb_ban_by_country(data, f_country): reader = geoip2.database.Reader(f_country) d = {} for ip, date in data: - response = reader.country(ip) - country = response.country.name + try: + response = reader.country(ip) + country = response.country.name + except: + country = "n/c" if country in d.keys(): d[country] += 1 else: