add snmp python lib
Some checks failed
build container icinga2 / build (push) Has been cancelled

This commit is contained in:
2025-02-07 00:52:53 +01:00
parent 0b34e5351f
commit 2b56d04054

View File

@@ -23,6 +23,16 @@ RUN ["bash", "-exo", "pipefail", "-c", "\
apt clean all ; \ apt clean all ; \
rm -vrf /var/lib/apt/lists/* "] rm -vrf /var/lib/apt/lists/* "]
## install easysnmp
# need for full-features (add maybe if need): libsnmp-dev snmp-mibs-downloader
ARG SOURCELIST_FILE="/etc/apt/sources.list.d/debian.sources"
RUN ["bash", "-exo", "pipefail", "-c", "\
sed -i 's|main|main non-free|g' $SOURCELIST_FILE ; \
apt update ; \
apt-get install -y python3-easysnmp ; \
apt clean all ; \
rm -vrf /var/lib/apt/lists/* "]
## create persistend data store ## create persistend data store
RUN ["bash", "-exo", "pipefail", "-c", "\ RUN ["bash", "-exo", "pipefail", "-c", "\
mkdir -p /data ; \ mkdir -p /data ; \
@@ -36,6 +46,7 @@ RUN ["bash", "-exo", "pipefail", "-c", "\
ln -vs /data/var/icinga2 /var/lib/icinga2 ; \ ln -vs /data/var/icinga2 /var/lib/icinga2 ; \
ln -vs /data/plugins /usr/lib/nagios/plugins "] ln -vs /data/plugins /usr/lib/nagios/plugins "]
## basic aliases
RUN ["bash", "-exo", "pipefail", "-c", "\ RUN ["bash", "-exo", "pipefail", "-c", "\
echo alias icinga2reload=\"'/usr/lib/icinga2/safe-reload /etc/default/icinga2'\" >> /root/.bashrc ; \ echo alias icinga2reload=\"'/usr/lib/icinga2/safe-reload /etc/default/icinga2'\" >> /root/.bashrc ; \
echo alias icinga2checkconfig=\"'icinga2 daemon -C -X'\" >> /root/.bashrc "] echo alias icinga2checkconfig=\"'icinga2 daemon -C -X'\" >> /root/.bashrc "]