Skip to content

Commit

Permalink
Add container for sflow testing
Browse files Browse the repository at this point in the history
  • Loading branch information
jbemmel committed Oct 9, 2023
1 parent 9a456e8 commit 7d54dcb
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 0 deletions.
23 changes: 23 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,29 @@ services:
- .:/srv/ixpmanager
- mrtg-data:/srv/mrtg

sflow-scripts:
build:
context: tools/docker/containers/sflow-scripts
depends_on:
- "mysql"
networks:
ixpmanager:
ipv4_address: 172.30.201.21
ipv6_address: fd99::21
aliases:
- ixpmanager-sflow-scripts
extra_hosts:
- "rs1-ipv4:172.30.201.30"
- "rs1-ipv4.ixpmanager:172.30.201.30"
- "rs1-ipv6:172.30.201.30"
- "rs1-ipv6.ixpmanager:172.30.201.30"
- "switch1:172.30.201.60"
- "switch2:172.30.201.61"
volumes:
- .:/srv/ixpmanager
stdin_open: true
tty: true

routinator:
build:
context: tools/docker/containers/routinator
Expand Down
32 changes: 32 additions & 0 deletions tools/docker/containers/sflow-scripts/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
FROM ubuntu:23.04

# RUN apt-get -y update && \
# apt-get -y upgrade && \
# apt-get -y autoremove --purge && \
# apt-get -y clean && \
# rm -rf /var/lib/apt/lists/* && \
# rm -rf /tmp/*

# JvB added for sflow testing
RUN apt-get -y update && apt-get install -y perl-base bash make gcc cpanminus libmysqlclient-dev

RUN cpanm install NetAddr::IP Config::General NetPacket::TCP

# Tests fail, force install
RUN cpanm install DBD::mysql --force

COPY ixpmanager.conf /usr/local/etc/ixpmanager.conf

# sflowtool for traditional workflow
RUN apt-get install -y git autoconf
RUN git clone https://github.com/sflow/sflowtool.git && \
cd sflowtool && \
./boot.sh && \
./configure && \
make && \
make install

WORKDIR /

ENTRYPOINT "/bin/bash"
CMD "/bin/bash"
18 changes: 18 additions & 0 deletions tools/docker/containers/sflow-scripts/ixpmanager.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<sql>
dbase_type = mysql
dbase_database = ixpmanager
dbase_username = ixpmanager
dbase_password = ixpmanager
dbase_hostname = ixpmanager-mysql
</sql>

<ixp>
sflowtool = /usr/bin/sflowtool
sflowtool_opts = -4 -p 6343 -l
sflow_rrdcached = 1
sflow_rrddir = /data/ixpmatrix

apikey = APIKeyFromIXPManager
apibaseurl = http://www.example.com/ixp/api/v4
macdbtype = configured
</ixp>

0 comments on commit 7d54dcb

Please sign in to comment.