fail2ban-geo-exporter icon indicating copy to clipboard operation
fail2ban-geo-exporter copied to clipboard

KeyError: 'sshd'

Open laemm-line opened this issue 3 years ago • 5 comments

Hello,

I get the following error when I try to start the exporter:

Traceback (most recent call last):
  File "/f2b-exporter/fail2ban-exporter.py", line 127, in <module>
    REGISTRY.register(F2bCollector(conf))
  File "/usr/lib/python3.7/site-packages/prometheus_client/registry.py", line 24, in register
    names = self._get_names(collector)
  File "/usr/lib/python3.7/site-packages/prometheus_client/registry.py", line 64, in _get_names
    for metric in desc_func():
  File "/f2b-exporter/fail2ban-exporter.py", line 76, in collect
    self.get_jailed_ips()
  File "/f2b-exporter/fail2ban-exporter.py", line 59, in get_jailed_ips
    bantime = config[j[0]]['bantime'].split(';')[0].strip()
  File "/usr/lib/python3.7/configparser.py", line 958, in __getitem__
    raise KeyError(key)
KeyError: 'sshd'

laemm-line avatar Jul 10 '21 23:07 laemm-line