shizunge / endlessh-go

A golang implementation of endlessh exporting Prometheus metrics, visualized by a Grafana dashboard.
GNU General Public License v3.0
982 stars 31 forks source link

[QUESTION] Where does the 'Normal' log output go to? (fail2ban) #42

Closed BlackWolfWoof closed 1 year ago

BlackWolfWoof commented 1 year ago

I am trying to get the logs so fail2ban can read them, but wondered where the logs to to so i can bind them to a volume/mount.

version: '3.5'
services:
  endlessh:
    container_name: tarpit-endlessh
    image: shizunge/endlessh-go:latest
    restart: unless-stopped
    command:
      - -interval_ms=1000
      - -logtostderr
      - -v=1
      - -enable_prometheus
      - -geoip_supplier=ip-api
      - -log_dir=/example
    ports:
      - 22:2222
#      - 9101:2112 #prometheus port (now handled via networks)
    networks:
    - default
    - prometheus
    volumes:
    - /home/user/example:/example

networks:
  prometheus:
    external: true

Here i tried to put it into /example of the container and then ls /home/user/example, but nothing was logged there. I am probably doing something wrong so if you see what mistake i made could you please point it out to me, thanks :)

shizunge commented 1 year ago

Instead of using -logtostderr, try -alsologtostderr

BlackWolfWoof commented 1 year ago

Instead of using -logtostderr, try -alsologtostderr

Awooo XeHe82nDbz Didn't give me any logs 🤷

shizunge commented 1 year ago

permission issue. endlessh runs as nobody in the container. Make sure nobody can write to the folder.

e.g. run chmod 777 /home/user/example before starting the container.

shizunge commented 1 year ago

Or you may specify the user https://docs.docker.com/compose/compose-file/#user to the container.