SNMP custom port

This commit is contained in:
Radek committed 2025-03-06 13:11:09 +00:00
1 parent 8b5c2f0ca2
commit 65014dabf4
3 files changed
+15 -7

No files matched your search

+2 -2
View File
@@ -16,8 +16,8 @@ RUN chmod +x /usr/local/bin/custom_snmp_script.py
# Configure snmpd to use the custom script
RUN echo "extend customOID /usr/local/bin/custom_snmp_script.py" >> /etc/snmp/snmpd.conf
# Expose the SNMP port
# Expose the SNMP port using an environment variable
EXPOSE 161/udp
# Start snmpd with environment variables
CMD ["sh", "-c", "snmpd -f -c /etc/snmp/snmpd.conf -Lf /dev/null -p /var/run/snmpd.pid -a -x $SNMP_COMMUNITY"]
CMD ["sh", "-c", "snmpd -f -c /etc/snmp/snmpd.conf -Lf /dev/null -p /var/run/snmpd.pid -a -x $SNMP_COMMUNITY -p $SNMP_PORT"]