diff --git a/images/nagios/Dockerfile b/images/nagios/Dockerfile index a171634..b9440ae 100644 --- a/images/nagios/Dockerfile +++ b/images/nagios/Dockerfile @@ -8,7 +8,7 @@ LABEL org.label-schema.build-date=$BUILD_DATE \ org.label-schema.vcs-ref=$VCS_REF \ org.label-schema.vcs-url=https://github.com/instantlinux/docker-tools -ARG NAGIOS_VERSION=4.4.13-r1 +ARG NAGIOS_VERSION=4.5.1-r0 ARG NAGIOS_GID=1000 ARG NAGIOS_UID=999 ARG PLUGINS_VERSION=2.4.5-r1 @@ -29,13 +29,14 @@ RUN deluser xfs && addgroup -g $NAGIOS_GID nagios && \ adduser -g www-data -u $WWW_UID -DSH -h /var/www www-data && \ adduser -G nagios -g "Nagios Server" -DSH -h /var/nagios -u $NAGIOS_UID \ nagios && \ - apk add --update --no-cache nagios=$NAGIOS_VERSION nagios-web \ + echo '@edge http://dl-cdn.alpinelinux.org/alpine/edge/main' \ + >>/etc/apk/repositories && \ + apk add --update --no-cache nagios@edge=$NAGIOS_VERSION nagios-web \ nagios-plugins-all=$PLUGINS_VERSION \ nagios-plugins-mysql=$PLUGINS_VERSION \ nrpe-plugin bash curl fcgiwrap file mariadb-client nginx openssl \ perl-crypt-x509 perl-libwww perl-text-glob perl-timedate \ - php81 php81-fpm py3-pip python3 ssmtp tzdata && \ - pip3 install pymysql==1.0.2 && \ + php81 php81-fpm py3-pip py3-pymysql python3 ssmtp tzdata && \ addgroup nginx nagios && \ chmod u+s /usr/lib/nagios/plugins/check_ping && \ sed -i -e s/use_syslog=.*/use_syslog=0/ \ @@ -50,6 +51,6 @@ EXPOSE 80 VOLUME /etc/nagios /opt/nagios/plugins /var/nagios COPY nginx.conf /etc/nginx/http.d/nagios.conf -COPY php-fpm-www.conf /etc/php8/php-fpm.d/www.conf +COPY php-fpm-www.conf /etc/php81/php-fpm.d/www.conf COPY entrypoint.sh mail.sh /usr/local/bin/ ENTRYPOINT /usr/local/bin/entrypoint.sh diff --git a/images/nagios/entrypoint.sh b/images/nagios/entrypoint.sh index 3698e49..4660eec 100755 --- a/images/nagios/entrypoint.sh +++ b/images/nagios/entrypoint.sh @@ -94,19 +94,10 @@ for item in backup hosts services; do done start-stop-daemon -u nginx -b --exec /usr/bin/fcgiwrap -- \ -s unix:/run/fcgiwrap/fcgiwrap.sock -/usr/sbin/php-fpm8 +/usr/sbin/php-fpm81 /usr/sbin/nginx touch /var/nagios/nagios.log && tail -1 -f /var/nagios/nagios.log & find /var/nagios -not -user nagios -exec chown nagios.nagios {} \; find /etc/nagios/objects -not -user www-data -exec chown www-data.nagios {} \; -# TODO change this back to exec after fix is published -# https://github.com/NagiosEnterprises/nagioscore/issues/861 -if ! /usr/sbin/nagios /etc/nagios/nagios.cfg; then - echo Segfault - please set check_for_updates=0 in /etc/nagios/nagios.cfg - exit 1 -fi - -while [ 1 == 1 ]; do - sleep 60 -done +exec /usr/sbin/nagios /etc/nagios/nagios.cfg