From a1e03826c0a904b93d60bd8d44f14cc6ba087314 Mon Sep 17 00:00:00 2001 From: jwansek Date: Sun, 24 Dec 2023 14:46:04 +0000 Subject: Added SNMP client for monitoring omada switches --- switch-snmp/Dockerfile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 switch-snmp/Dockerfile (limited to 'switch-snmp/Dockerfile') diff --git a/switch-snmp/Dockerfile b/switch-snmp/Dockerfile new file mode 100644 index 0000000..66857fa --- /dev/null +++ b/switch-snmp/Dockerfile @@ -0,0 +1,16 @@ +FROM ubuntu:20.04 +ENV TZ=Europe/London +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone +RUN apt-get update -y +RUN apt-get install -y python3-pip iputils-ping cron wget snmp snmp-mibs-downloader unzip +COPY . /app +WORKDIR /app +RUN wget "https://static.tp-link.com/upload/software/2022/202209/20220915/privateMibs(20220831).zip" +RUN mkdir -p /usr/share/snmp/mibs +RUN unzip -j "privateMibs(20220831).zip" -d /usr/share/snmp/mibs +RUN pip3 install -r requirements.txt +RUN rm "privateMibs(20220831).zip" + +RUN echo "*/1 * * * * root python3 /app/snmp-omada.py > /proc/1/fd/1 2>/proc/1/fd/2" > /etc/crontab +ENTRYPOINT ["bash"] +CMD ["entrypoint.sh"] \ No newline at end of file -- cgit v1.2.3