Skip to content

Commit

Permalink
SYS-622 nagios 4.5.1 image update
Browse files Browse the repository at this point in the history
  • Loading branch information
instantlinux committed May 3, 2024
1 parent d7c058b commit 1ef0c41
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
11 changes: 6 additions & 5 deletions images/nagios/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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/ \
Expand All @@ -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
13 changes: 2 additions & 11 deletions images/nagios/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 1ef0c41

Please sign in to comment.