Fail2ban log isn't written, possibly service isn't running

Hi,

I’ve been trying to configure fail2ban and has followed the cookbook here to the letter
However, I don’t see the log file where it should’ve been and get this error

[homeassistant.config] Invalid config for [sensor.fail2ban]: file not readable for dictionary value @ data['file_path']. Got '/var/log/fail2ban.log'. (See ?, line ?). Please check the docs at https://home-assistant.io/components/sensor.fail2ban/ 

Any ideas on where to start looking ?

Make sure that /var/log/fail2ban.log is readable, by default it probably isn’t.

sudo chmod a+r /var/log/fail2ban.log

Thanks, some progress but still not there :

TypeError: unsupported operand type(s) for -: 'datetime.datetime' and 'NoneType'
2017-11-29 15:25:46 ERROR (MainThread) [homeassistant.components.sensor] Error on device update!
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_component.py", line 217, in     
 async_add_entity
    yield from entity.async_device_update(warning=False)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 306, in             
async_device_update
   yield from self.hass.async_add_job(self.update)
File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__
yield self  # This tells Task to wait for completion.
File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
future.result()
File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
raise self._exception
File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/sensor/fail2ban.py", line 91, in 
update
if self.log_parser.timer():
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/sensor/fail2ban.py", line 129, in timer
boundary = dt_util.now() - self.interval
TypeError: unsupported operand type(s) for -: 'datetime.datetime' and 'NoneType'

Hi ohadbenita,

To fix that error see my response here. Basically, scan_interval was intended to be optional, but as of now that is not true. Setting scan_interval in your config will fix that issue.