Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #37

Merged
merged 68 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
fe679e9
Update base image to Ubuntu 24.04
tronyx Apr 30, 2024
cf9a124
Update build file to use Ubuntu 24.04 branch
tronyx Apr 30, 2024
90c4cbc
Updates for Nagios Core and Plugins
tronyx May 6, 2024
d490bfe
Update Nagios Core to 4.5.2 and Nagios Plugins to 2.4.10
tronyx May 6, 2024
a2fda9b
Preparing for when new Ubuntu 24 runners become available [skip ci]
tronyx May 6, 2024
41bd0b6
Making Labels and ENVs more readable [skip ci]
tronyx May 6, 2024
75937d3
Minor update
tronyx May 14, 2024
c61d42c
Update packages list
tronyx May 14, 2024
4bd68a2
Try to get additional plugins installed
tronyx May 14, 2024
9603358
Try to get additional plugins installed
tronyx May 14, 2024
d33c921
Try to get additional plugins installed
tronyx May 14, 2024
ead6867
Update NCPA to 3.1.0
tronyx May 27, 2024
6927f7c
Update NagiosTV to v0.9.0
tronyx May 27, 2024
4dd74c7
Update NCPA to 3.1.0 [skip ci]
tronyx May 27, 2024
7b754ab
Update NagiosTV to v0.9.0 [skip ci]
tronyx May 27, 2024
17caf79
Add PR 165 from upstream project [skip ci]
tronyx May 27, 2024
9c37ebe
Add PR 165 from upstream project
tronyx May 27, 2024
af7956d
Add version/tag section [skip ci]
tronyx May 30, 2024
13922bc
Comment out lines for old Python 2 based plugins and their dependencies
tronyx May 30, 2024
042145d
Make version/docker tag section look better [skip ci]
tronyx May 30, 2024
7220ac7
Remove check_mqtt plugin as it is Python 2 [skip ci]
tronyx May 30, 2024
57ea865
Comment out the rustup cleanup line
tronyx May 31, 2024
bc1f699
Merge branch 'develop' into ubuntu-24.04
tronyx May 31, 2024
fb69c00
Merge pull request #36 from tronyx/ubuntu-24.04
tronyx May 31, 2024
a8093b4
Trying to get the additional Plugins working again
tronyx May 31, 2024
7de83b5
Trying to get the additional Plugins working again
tronyx May 31, 2024
3e63ac7
Add curl to list of installed packages
tronyx May 31, 2024
c412785
Comment out Cylance version constraint lines
tronyx May 31, 2024
f230108
Update NagiosTV to 0.9.2
tronyx Jun 10, 2024
595e72b
Add default configurations for nagios graph if the directory is empty
tronyx Jun 10, 2024
baf71d9
Another attemt at getting the Additional Plugins working with Ubuntu 24
tronyx Jun 10, 2024
0234e2b
Trying to get PyMssql to install
tronyx Jun 10, 2024
36389c5
Trying to get PyMssql to install
tronyx Jun 10, 2024
852e361
Trying to get PyMssql to install
tronyx Jun 10, 2024
e303d07
Trying to get PyMssql to install
tronyx Jun 11, 2024
8d6ff51
Add installation of libffi-dev
tronyx Jun 11, 2024
52fb80a
Add installation of gcc-arm*
tronyx Jun 11, 2024
3f09d17
Update checkout action to v4
tronyx Jun 11, 2024
787b9e2
Update setup-qemu-action to v3.0.0
tronyx Jun 11, 2024
dedd766
Update setup-buildx-action to v3.3.0
tronyx Jun 11, 2024
6b57a73
Update login-action to v3.2.0
tronyx Jun 11, 2024
5ec8d8b
Update build-push to v5.4.0
tronyx Jun 11, 2024
e17b419
Remove commented lines
tronyx Jun 11, 2024
01d21fb
Change 22.04 to 24.04 [skip ci]
tronyx Jun 11, 2024
d5e7c93
Update moby/buildkit to v0.14.0
tronyx Jun 11, 2024
44c4ff4
Swap Python VENV for --break-system-packages
tronyx Jun 12, 2024
ef691b1
Remove commented lines
tronyx Jun 12, 2024
d3895dd
Revert moby buildkit version from 0.14.0 to 0.10.5
tronyx Jun 12, 2024
5ededc2
Increasing swap space from 10GB to 20GB to see if that is why armv7 b…
tronyx Jun 12, 2024
2c00321
Ditch arm-v7 build
tronyx Jun 12, 2024
1895e04
Try buildkit v0.14.0 again
tronyx Jun 12, 2024
7f7159c
Add note about arm-v7 [skip ci]
tronyx Jun 12, 2024
4daadbd
Minor updates [skip ci]
tronyx Jun 12, 2024
4c60ab3
Minor updates [skip ci]
tronyx Jun 12, 2024
9972239
Change to moby/buildkit:master
tronyx Jun 12, 2024
39c20b8
Switch to buildx and comment out 2nd attempts
tronyx Jun 12, 2024
c44a38b
Add time output
tronyx Jun 12, 2024
e450640
Minor fixes
tronyx Jun 12, 2024
66eff69
Minor fixes
tronyx Jun 12, 2024
084e5a6
Fix SOURCE var
tronyx Jun 12, 2024
ff7feb1
Remove commented code [skip ci]
tronyx Jun 12, 2024
7b9a775
Update Nagios to 4.5.3 [skip ci]
tronyx Jun 12, 2024
8b29936
Update Nagios Core to 4.5.3
tronyx Jun 12, 2024
9db0b0f
Update Nagios Plusings to 2.4.11
tronyx Aug 4, 2024
d957c98
Update NRPE to 4.1.1
tronyx Aug 4, 2024
a2bbdbe
Update NSCA to 2.10.3
tronyx Aug 4, 2024
1e5452c
Update ENVs to use key=value format [skip ci]
tronyx Aug 5, 2024
4f1c2f0
Update Nagios Core to 4.5.4
tronyx Aug 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 20 additions & 102 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,56 +13,46 @@ on:
jobs:
build:
if: "!contains(github.event.head_commit.message, 'skip ci')"
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
matrix:
architecture: [linux-amd64, linux-arm64, linux-arm-v7]
architecture: [linux-amd64, linux-arm64]
outputs:
version: ${{ steps.prep.outputs.version }}
branch: ${{ steps.prep.outputs.branch }}
time: ${{ steps.vars.outputs.time }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Check if architecture exists
id: arch_check
run: |
(test -f Dockerfile.${{ matrix.architecture }} && echo "check=passed" >> $GITHUB_OUTPUT) || echo "check=failed" >> $GITHUB_OUTPUT

# Workaround for Cargo issue: https://github.com/rust-lang/cargo/issues/8719
- name: Set Swap Space
uses: pierotofy/[email protected]
with:
swap-size-gb: 10
- run: |
sudo mkdir -p /var/lib/docker
sudo mount -t tmpfs -o size=10G none /var/lib/docker
sudo systemctl restart docker

- name: Set up QEMU
if: "contains(steps.arch_check.outputs.check, 'passed')"
uses: docker/setup-qemu-action@v2.1.0
uses: docker/setup-qemu-action@v3.0.0

- name: Set up Docker Buildx
if: "contains(steps.arch_check.outputs.check, 'passed')"
uses: docker/setup-buildx-action@v2.4.1
uses: docker/setup-buildx-action@v3.3.0
with:
install: true
version: latest
# Fix for https://github.com/docker/buildx/issues/1509
driver-opts: image=moby/buildkit:v0.10.5 #:master
driver-opts: image=moby/buildkit:master

- name: Login to docker.io
if: "contains(steps.arch_check.outputs.check, 'passed')"
uses: docker/login-action@v2.1.0
uses: docker/login-action@v3.2.0
with:
registry: docker.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Login to ghcr.io
if: "contains(steps.arch_check.outputs.check, 'passed')"
uses: docker/login-action@v2.1.0
uses: docker/login-action@v3.2.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
Expand Down Expand Up @@ -96,41 +86,11 @@ jobs:

echo $GITHUB_OUTPUT

- name: Build and push - Attempt 1
- name: Build and push
continue-on-error: true
if: "contains(steps.arch_check.outputs.check, 'passed')"
id: build_attempt1
uses: docker/[email protected]
with:
push: true
platforms: ${{ steps.prep.outputs.platform }}
file: ./Dockerfile.${{ matrix.architecture }}
cache-from: docker.io/${{ steps.prep.outputs.cache }}
cache-to: docker.io/${{ steps.prep.outputs.cache }}
tags: |
docker.io/${{ steps.prep.outputs.tag }}
ghcr.io/${{ steps.prep.outputs.tag }}
labels: |
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
org.opencontainers.image.title=${{ steps.prep.outputs.title }}
org.opencontainers.image.revision=${{ steps.prep.outputs.revision }}
org.opencontainers.image.source=${{ steps.prep.outputs.source }}
org.opencontainers.image.vendor=${{ steps.prep.outputs.vendor }}
org.opencontainers.image.url=${{ steps.prep.outputs.url }}
org.opencontainers.image.version=${{ steps.prep.outputs.version }}
build-args: |
GITHUB_TOKEN=${{ secrets.GHCR_TOKEN }}
BUILD_ARCHITECTURE=${{ matrix.architecture }}
${{ steps.prep.outputs.build-args }}

- name: Sleep
if: (steps.build_attempt1.outcome == 'failure')
run: |
sleep 30

- name: Build and push - Attempt 2
if: (steps.build_attempt1.outcome == 'failure')
uses: docker/[email protected]
uses: docker/[email protected]
with:
push: true
platforms: ${{ steps.prep.outputs.platform }}
Expand All @@ -154,32 +114,32 @@ jobs:
${{ steps.prep.outputs.build-args }}

publish:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
matrix:
registry: [docker.io, ghcr.io]
needs: [build]
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Login to docker.io
if: matrix.registry == 'docker.io'
uses: docker/login-action@v2.1.0
uses: docker/login-action@v3.2.0
with:
registry: docker.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Login to ghcr.io
if: matrix.registry == 'ghcr.io'
uses: docker/login-action@v2.1.0
uses: docker/login-action@v3.2.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_TOKEN }}

- name: Create manifests - Attempt 1
- name: Create manifests
continue-on-error: true
id: manifest_attempt1
env:
Expand All @@ -189,50 +149,8 @@ jobs:
TAG=${{ needs.build.outputs.branch }}
SOURCE=${IMAGE}:${TAG}-${GITHUB_SHA:0:7}-${GITHUB_RUN_NUMBER}
VERSION=${{ needs.build.outputs.version }}
BRANCH=${{ needs.build.outputs.branch }}
[[ -f Dockerfile.linux-amd64 ]] && AMD64=${SOURCE}-linux-amd64
[[ -f Dockerfile.linux-arm64 ]] && ARM64=${SOURCE}-linux-arm64
[[ -f Dockerfile.linux-arm-v7 ]] && ARMV7=${SOURCE}-linux-arm-v7
docker manifest create ${IMAGE}:${TAG} ${AMD64} ${ARM64} ${ARMV7}
docker manifest push ${IMAGE}:${TAG}
docker manifest create ${IMAGE}:${TAG}-${VERSION} ${AMD64} ${ARM64} ${ARMV7}
docker manifest push ${IMAGE}:${TAG}-${VERSION}
docker manifest create ${IMAGE}:${TAG}-${VERSION} ${AMD64} ${ARM64} ${ARMV7}
docker manifest push ${IMAGE}:${TAG}-${VERSION}
if [[ ${BRANCH} == master ]]; then
docker manifest create ${IMAGE}:latest ${AMD64} ${ARM64} ${ARMV7}
docker manifest push ${IMAGE}:latest
fi

- name: Sleep
if: (steps.manifest_attempt1.outcome == 'failure')
run: |
sleep 30

- name: Create manifests - Attempt 2
if: (steps.manifest_attempt1.outcome == 'failure')
env:
DOCKER_CLI_EXPERIMENTAL: enabled
run: |
IMAGE=${{ matrix.registry }}/$(echo ${GITHUB_REPOSITORY} | tr '[:upper:]' '[:lower:]' | sed s/docker-//)
TAG=${{ needs.build.outputs.branch }}
SOURCE=${IMAGE}:${TAG}-${GITHUB_SHA:0:7}-${GITHUB_RUN_NUMBER}
VERSION=${{ needs.build.outputs.version }}
BRANCH=${{ needs.build.outputs.branch }}
[[ -f Dockerfile.linux-amd64 ]] && AMD64=${SOURCE}-linux-amd64
[[ -f Dockerfile.linux-arm64 ]] && ARM64=${SOURCE}-linux-arm64
[[ -f Dockerfile.linux-arm-v7 ]] && ARMV7=${SOURCE}-linux-arm-v7
docker manifest rm ${IMAGE}:${TAG} || true
docker manifest create ${IMAGE}:${TAG} ${AMD64} ${ARM64} ${ARMV7}
docker manifest push ${IMAGE}:${TAG}
docker manifest rm ${IMAGE}:${TAG}-${VERSION} || true
docker manifest create ${IMAGE}:${TAG}-${VERSION} ${AMD64} ${ARM64} ${ARMV7}
docker manifest push ${IMAGE}:${TAG}-${VERSION}
docker manifest rm ${IMAGE}:${TAG}-${VERSION} || true
docker manifest create ${IMAGE}:${TAG}-${VERSION} ${AMD64} ${ARM64} ${ARMV7}
docker manifest push ${IMAGE}:${TAG}-${VERSION}
if [[ ${BRANCH} == master ]]; then
docker manifest rm ${IMAGE}:latest || true
docker manifest create ${IMAGE}:latest ${AMD64} ${ARM64} ${ARMV7}
docker manifest push ${IMAGE}:latest
docker buildx imagetools create -t ${IMAGE}:${TAG} ${SOURCE}-linux-amd64 ${SOURCE}-linux-arm64
docker buildx imagetools create -t ${IMAGE}:${TAG}-${VERSION} ${SOURCE}-linux-amd64 ${SOURCE}-linux-arm64
if [[ ${GITHUB_REF//refs\/heads\//} == main ]]; then
docker buildx imagetools create -t ${IMAGE}:latest ${SOURCE}-linux-amd64 ${SOURCE}-linux-arm64
fi
100 changes: 53 additions & 47 deletions Dockerfile.linux-amd64
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,43 @@
ARG BUILDKIT_SBOM_SCAN_CONTEXT=true
ARG BUILDKIT_SBOM_SCAN_STAGE=true

FROM ubuntu:22.04

LABEL name="Nagios" \
nagiosVersion="4.5.1" \
nagiosPluginsVersion="2.4.9" \
nrpeVersion="4.1.0" \
nscaVersion="2.10.2" \
ncpaVersion="3.0.2" \
nagiostvVersion="0.8.7" \
homepage="https://www.nagios.com/" \
maintainer="Tronyx <[email protected]>"
FROM ubuntu:24.04

LABEL name="Nagios"
LABEL nagiosVersion="4.5.4"
LABEL nagiosPluginsVersion="2.4.11"
LABEL nrpeVersion="4.1.1"
LABEL nscaVersion="2.10.3"
LABEL ncpaVersion="3.1.0"
LABEL nagiostvVersion="0.9.2"
LABEL homepage="https://www.nagios.com/"
LABEL maintainer="Tronyx <[email protected]>"

# Environment variables
ENV NAGIOS_HOME=/opt/nagios \
NAGIOS_USER=nagios \
NAGIOS_GROUP=nagios \
NAGIOS_CMDUSER=nagios \
NAGIOS_CMDGROUP=nagios \
NAGIOS_FQDN=nagios.example.com \
NAGIOSADMIN_USER=nagiosadmin \
NAGIOSADMIN_PASS=nagios \
APACHE_RUN_USER=nagios \
APACHE_RUN_GROUP=nagios \
APACHE_LOCK_DIR=/var/run \
APACHE_LOG_DIR=/var/log/apache2 \
NAGIOS_TIMEZONE=UTC \
DEBIAN_FRONTEND=noninteractive \
NAGIOS_BRANCH=nagios-4.5.1 \
NAGIOS_PLUGINS_BRANCH=release-2.4.9 \
NRPE_BRANCH=nrpe-4.1.0 \
NSCA_TAG=nsca-2.10.2 \
NCPA_BRANCH=v3.0.2 \
NAGIOSTV_VERSION=0.8.7

ENV NG_CGI_URL=/cgi-bin \
NG_NAGIOS_CONFIG_FILE=${NAGIOS_HOME}/etc/nagios.cfg \
NG_CGI_DIR=${NAGIOS_HOME}/sbin \
NG_WWW_DIR=${NAGIOS_HOME}/share/nagiosgraph
ENV NAGIOS_HOME=/opt/nagios
ENV NAGIOS_USER=nagios
ENV NAGIOS_GROUP=nagios
ENV NAGIOS_CMDUSER=nagios
ENV NAGIOS_CMDGROUP=nagios
ENV NAGIOS_FQDN=nagios.example.com
ENV NAGIOSADMIN_USER=nagiosadmin
ENV NAGIOSADMIN_PASS=nagios
ENV APACHE_RUN_USER=nagios
ENV APACHE_RUN_GROUP=nagios
ENV APACHE_LOCK_DIR=/var/run
ENV APACHE_LOG_DIR=/var/log/apache2
ENV NAGIOS_TIMEZONE=UTC
ENV DEBIAN_FRONTEND=noninteractive
ENV NG_CGI_URL=/cgi-bin
ENV NG_NAGIOS_CONFIG_FILE=${NAGIOS_HOME}/etc/nagios.cfg
ENV NG_CGI_DIR=${NAGIOS_HOME}/sbin
ENV NG_WWW_DIR=${NAGIOS_HOME}/share/nagiosgraph
ENV NAGIOS_BRANCH=nagios-4.5.4
ENV NAGIOS_PLUGINS_BRANCH=release-2.4.11
ENV NRPE_BRANCH=nrpe-4.1.1
ENV NSCA_TAG=nsca-2.10.3
ENV NCPA_BRANCH=v3.1.0
ENV NAGIOSTV_VERSION=0.9.2

RUN echo postfix postfix/main_mailer_type string "'Internet Site'" | debconf-set-selections && \
echo postfix postfix/mynetworks string "127.0.0.0/8" | debconf-set-selections && \
Expand All @@ -56,6 +55,7 @@ RUN echo postfix postfix/main_mailer_type string "'Internet Site'" | debconf-set
bsd-mailx \
build-essential \
ca-certificates \
curl \
dnsutils \
fping \
freetds-dev \
Expand All @@ -69,6 +69,7 @@ RUN echo postfix postfix/main_mailer_type string "'Internet Site'" | debconf-set
libcgi-pm-perl \
libcrypt-des-perl \
libcrypt-rijndael-perl \
libcrypt-x509-perl \
libdbd-mysql-perl \
libdbd-pg-perl \
libdbi-dev \
Expand All @@ -81,30 +82,31 @@ RUN echo postfix postfix/main_mailer_type string "'Internet Site'" | debconf-set
libgd-gd2-perl \
libjson-perl \
libldap2-dev \
libmysqlclient-dev \
libmariadb-dev \
libnagios-object-perl \
libmonitoring-plugin-perl \
libnet-snmp-perl \
libnet-tftp-perl \
libnet-xmpp-perl \
libpq-dev \
libpython2-dev \
libpython3-dev \
libredis-perl \
librrds-perl \
libssl-dev \
libswitch-perl \
libtext-glob-perl \
libwww-perl \
m4 \
netcat \
netcat-traditional \
openssh-client \
parallel \
php-cli \
php-gd \
postfix \
python2 \
python3-pip \
python3-full \
python3-nagiosplugin \
python3-pip \
python3-venv \
rsync \
rsyslog \
runit \
Expand Down Expand Up @@ -219,11 +221,11 @@ RUN cd /tmp && \

# Install additional plugins
RUN cd /opt && \
wget -q -O get-pip.py https://bootstrap.pypa.io/pip/2.7/get-pip.py && \
python2 get-pip.py && \
pip install --no-cache-dir "pymssql<2.2.0" && \
pip3 install --no-cache-dir --find-links https://wheel-index.linuxserver.io/ubuntu/ pywbem paramiko pplogger paho-mqtt && \
pip3 install --no-cache-dir --find-links https://wheel-index.linuxserver.io/ubuntu/ --upgrade requests && \
#python3 -m venv .venv && \
#. .venv/bin/activate && \
pip3 install --break-system-packages --no-cache-dir pymssql && \
pip3 install --break-system-packages --no-cache-dir --find-links https://wheel-index.linuxserver.io/ubuntu/ pywbem paramiko pplogger paho-mqtt && \
pip3 install --break-system-packages --no-cache-dir --find-links https://wheel-index.linuxserver.io/ubuntu/ --upgrade requests && \
git clone https://github.com/willixix/naglio-plugins.git WL-Nagios-Plugins && \
git clone https://github.com/JasonRivers/nagios-plugins.git JR-Nagios-Plugins && \
git clone https://github.com/justintime/nagios-plugins.git JE-Nagios-Plugins && \
Expand Down Expand Up @@ -286,9 +288,13 @@ RUN echo "use_timezone=${NAGIOS_TIMEZONE}" >> ${NAGIOS_HOME}/etc/nagios.cfg
# Copy example config in-case the user has started with empty var or etc
RUN mkdir -p /orig/var && \
mkdir -p /orig/etc && \
mkdir -p /orig/graph-etc && \
mkdir -p /orig/graph-var && \
mkdir -p /orig/xinetd.d && \
cp -Rp ${NAGIOS_HOME}/var/* /orig/var/ && \
cp -Rp ${NAGIOS_HOME}/etc/* /orig/etc/ && \
cp -Rp /opt/nagiosgraph/etc/* /orig/graph-etc && \
cp -Rp /opt/nagiosgraph/var/* /orig/graph-var && \
cp -Rp /etc/xinetd.d/* /orig/xinetd.d/

## Set the permissions for example config
Expand All @@ -310,7 +316,7 @@ RUN cd /opt/nagiosgraph/etc && \
sh fix-nagiosgraph-multiple-selection.sh

# Enable all runit services
RUN ln -s /etc/sv/* /etc/service
RUN ln -sf /etc/sv/* /etc/service

# Fix ping permissions for Nagios user
RUN chmod u+s /usr/bin/ping
Expand Down
Loading
Loading