concept and initial code

This commit is contained in:
Radek
2025-03-06 12:53:48 +00:00
parent 83fd56c750
commit c06e385bc9
3 changed files with 102 additions and 2 deletions

23
Dockerfile Normal file
View File

@@ -0,0 +1,23 @@
# Use a minimal base image
FROM alpine:latest
# Install necessary packages
RUN apk add --no-cache snmpd python3 py3-pip
# Install any additional Python packages if needed
RUN pip3 install --no-cache-dir random
# Copy the custom script into the container
COPY custom_snmp_script.py /usr/local/bin/custom_snmp_script.py
# Make the script executable
RUN chmod +x /usr/local/bin/custom_snmp_script.py
# Configure snmpd to use the custom script
RUN echo "extend .1.3.6.1.4.1.38446.1.2.4.1.9.1 /usr/local/bin/custom_snmp_script.py" >> /etc/snmp/snmpd.conf
# Expose the SNMP port
EXPOSE 161/udp
# Start snmpd
CMD ["snmpd", "-f"]