You've already forked prometheus-fail2ban-exporter
							
							feat: support for textfile metrics (#13)
Add support for collecting arbitrary metrics from a textfile as well as metrics collected from fail2ban. This allows other data to be exported along with the fail2ban metrics (e.g. instance metadata). Update the docker image to allow mounting a folder with a collection of metric files to be exported. Only files ending in `.prom` with be read. Update project README with the new functionality.
This commit is contained in:
		| @@ -5,6 +5,8 @@ | ||||
|  | ||||
| db_path=/app/fail2ban.sqlite3 | ||||
| socket_path=/var/run/fail2ban/fail2ban.sock | ||||
| textfile_dir=/app/textfile/ | ||||
| textfile_enabled=false | ||||
|  | ||||
| # Blank out the file paths if they do not exist - a hacky way to only use these files if they were mounted into the container. | ||||
| if [ ! -f "$db_path" ]; then | ||||
| @@ -13,9 +15,14 @@ fi | ||||
| if [ ! -S "$socket_path" ]; then | ||||
|     socket_path="" | ||||
| fi | ||||
| if [ -d $textfile_dir ]; then | ||||
|     textfile_enabled=true | ||||
| fi | ||||
|  | ||||
| # Start the exporter (use exec to support graceful shutdown) | ||||
| # Inspired by: https://akomljen.com/stopping-docker-containers-gracefully/ | ||||
| exec /app/fail2ban-prometheus-exporter \ | ||||
|     -db "$db_path" \ | ||||
|     -socket "$socket_path" | ||||
|     -socket "$socket_path" \ | ||||
|     -collector.textfile=$textfile_enabled \ | ||||
|     -collector.textfile.directory="$textfile_dir" | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Hector
					Hector