{"id":24440660,"url":"https://github.com/mivek/fail2ban_exporter","last_synced_at":"2025-07-13T01:04:12.115Z","repository":{"id":42490993,"uuid":"463928301","full_name":"mivek/fail2ban_exporter","owner":"mivek","description":"A fail2ban exporter for Prometheus","archived":false,"fork":false,"pushed_at":"2022-10-07T14:52:44.000Z","size":25,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-14T01:46:55.926Z","etag":null,"topics":["exporter","fail2ban","prometheus"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mivek.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"ko_fi":"mivek"}},"created_at":"2022-02-26T18:01:50.000Z","updated_at":"2022-06-22T14:09:41.000Z","dependencies_parsed_at":"2023-01-19T15:15:14.920Z","dependency_job_id":null,"html_url":"https://github.com/mivek/fail2ban_exporter","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/mivek/fail2ban_exporter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mivek%2Ffail2ban_exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mivek%2Ffail2ban_exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mivek%2Ffail2ban_exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mivek%2Ffail2ban_exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mivek","download_url":"https://codeload.github.com/mivek/fail2ban_exporter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mivek%2Ffail2ban_exporter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265076608,"owners_count":23707538,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["exporter","fail2ban","prometheus"],"created_at":"2025-01-20T20:56:57.830Z","updated_at":"2025-07-13T01:04:11.978Z","avatar_url":"https://github.com/mivek.png","language":"Python","funding_links":["https://ko-fi.com/mivek"],"categories":[],"sub_categories":[],"readme":"# Fail2Ban-exporter\n\n\nFail2ban exporter is an exporter for Prometheus.\nThe exporter exposes metrics on port 9921.\n\n## Requirements \n\n- Python 3: Only required if you execute the script. \n\n# Installation\n\n## Python script\n\nCheck the latest version.\n\nDownload the latest version.\n\nUnarchive it\n\n```\nwget https://github.com/mivek/fail2ban_exporter/releases/download/{{version}}/fail2ban_exporter-{{version}}.tar.gz\ntar -xzf fail2ban_exporter-{{version}}.tar.gz\n```\n\nInstall the dependencies\nLaunch the script\n\n```\npython -m pip install prometheus_client\npython fail2ban_exporter-0.0.2/src/fail2ban_exporter \u0026\n```\n\n\n\n## Python executable\n\nCheck the latest version\n\nDownload the latest version of the executable\n\nUnarchive it.\n\n```\nwget https://github.com/mivek/fail2ban_exporter/releases/download/{{ version }}/fail2ban_exporter_executable-{{ version }}.tar.gz\ntar -xzf fail2ban_exporter_executable-{{version}}.tar.gz\n```\n\nSet the execution mod to the executable and run it as the user running fail2ban-client.\n\n```\nchmod ug+x fail2ban_exporter_executable-{{ version }}/fail2ban_exporter\n./fail2ban_exporter \u0026\n```\n\n## Docker image\n\nIt is possible to run the exporter as a docker container.\nThe parent folder of the fail2ban socket needs to be mapped.\n\n**Note**: Do not map the socket itself as it is destroyed whenever fail2ban is stopped.\n\n### Docker run\n\n```\ndocker run -d \\\n--name \"fail2ban_exporter\" \\\n-v /var/run/fail2ban:/var/run/fail2ban:ro\n- p \"9921:9921\"\nghcr.io/mivek/fail2ban_exporter:latest\n```\n\n### Docker compose\n\n```(yaml)\nservices:\n    fail2ban_exporter:\n        image: ghcr.io/mivek/fail2ban_exporter:latest\n        ports:\n            - \"9921:9921\"\n        volumes:\n            - /var/run/fail2ban:/var/run/fail2ban:ro\n```\n\n# Metrics\n\nThe following metrics are exposed:\n\n| Name                      | Type    |  Description                                                 |\n|-----------------------    |-------  |--------------------------------------------------------------|\n| fail2ban_jail_count       | Gauge   | Number of active jails                                       |\n| fail2ban_failed_total     | Counter | Total number of failures. Labelled by the name of the jail   |\n| fail2ban_currently_failed | Gauge   | Current number of failures. Labelled by the name of the jail |\n| fail2ban_currently_banned | Gauge   | Current number of bans. Labelled by the name of the jail     |\n| fail2ban_banned_total     | Counter | Total number of bans. Labelled by the name of the jail       |\n\n\n# Environment variable\n\n- FAIL2BAN_EXPORTER_PORT . If specified the exporter will run on this port.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmivek%2Ffail2ban_exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmivek%2Ffail2ban_exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmivek%2Ffail2ban_exporter/lists"}