Skip to content

Commit

Permalink
flowgen_wrapper.sh: support domain names
Browse files Browse the repository at this point in the history
Create a wrapper script to support domain names to specify the
collector.
  • Loading branch information
msune committed Apr 21, 2024
1 parent df597ac commit 734ae17
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ FROM debian:bookworm-slim as builder
RUN apt-get update && apt-get -y install gcc make
COPY * /tmp/
RUN cd tmp && make && ls -la
RUN apt-get -y clean && rm -rf /var/lib/apt/lists/*

FROM debian:bookworm-slim
RUN apt-get -y install dnsutils
COPY --from=builder /tmp/flowgen /usr/bin/
ENTRYPOINT ["/usr/bin/flowgen"]
COPY --from=builder /tmp/flowgen_wrapper.sh /usr/bin/
ENTRYPOINT ["/usr/bin/flowgen_wrapper.sh"]
9 changes: 9 additions & 0 deletions flowgen_wrapper.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
set -e

# Attempt to resolve domain name
IP=$(dig +short ${@: -1})

#Print resolution
echo "Sending flow records to ${IP}..."
flowgen ${@:1:$#-1} ${IP}

0 comments on commit 734ae17

Please sign in to comment.